Share via

How can I disable swipe-back navigation in iOS MAUI while keeping the back button?

Omkar Pawar 295 Reputation points
2026-06-10T13:38:27.74+00:00

I am trying to disable swipe-back navigation in a .NET MAUI app on iOS because users are accidentally navigating back while signing or performing other actions.

I tried the usual approach of disabling the interactive pop gesture, but I am still able to navigate back by swiping.

Here is the repository code: https://github.com/IX-OmkarP/disable_swipe_back_iOS

I have also added a reproducible sample for reference.

Can anyone help me fully disable the swipe-back gesture?

Developer technologies | .NET | .NET Multi-platform App UI
0 comments No comments

Answer accepted by question author

Nancy Vo (WICLOUD CORPORATION) 5,700 Reputation points Microsoft External Staff Moderator
2026-06-11T03:18:57.33+00:00

Hello @Omkar Pawar ,

Thanks for your question.

Instead of disabling globally, I suggest disabling on sensitive pages like your signing page because Apple's HIG guideline 2.5.6 discourages disabling system gestures app-wide. Furthermore, Swipe-back is a familiar and expected iOS gesture.

You can refer to the following example code:

public partial class SignaturePage : ContentPage
{
    public SignaturePage()
    {
        InitializeComponent();
    }

    protected override void OnAppearing()
    {
        base.OnAppearing();

#if IOS
        SetSwipeBack(false);
#endif
    }

    protected override void OnDisappearing()
    {
        base.OnDisappearing();

#if IOS
        SetSwipeBack(true);
#endif
    }

#if IOS
    private void SetSwipeBack(bool enabled)
    {
        var vc = Platform.GetCurrentUIViewController();
        if (vc?.NavigationController?.InteractivePopGestureRecognizer != null)
        {
            vc.NavigationController.InteractivePopGestureRecognizer.Enabled = enabled;
        }
    }
#endif
}

If any part of my explanation helped address your question, I would greatly appreciate it if you could follow the instructions here. This can also help other community members facing similar scenarios.

Was this answer helpful?

1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,086 Reputation points
    2026-06-10T14:58:03.22+00:00

    note: disabling this gesture may get your app rejected from the store.

    Was this answer helpful?

    1 person found this answer helpful.

  2. Prateeksha Singh 0 Reputation points
    2026-06-10T15:06:43.16+00:00

    If you want to stop users from accidentally swiping back on iOS in your .NET MAUI app — but still keep the normal back button visible — the issue is that iOS handles swipe-back using its native navigation controller.

    In MAUI, simply disabling the gesture inside OnAppearing() usually doesn’t fully work because MAUI can recreate the navigation controller during navigation and the gesture gets enabled again automatically.

    The more reliable solution is to disable the native iOS swipe gesture through a custom Shell renderer.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.