Search code examples
iosnavigationnativescript

How to prevent navigation swipe on ios devices (Nativescript)


onPageLoaded(args) {
  args.object.ios.navigationController.interactivePopGestureRecognizer.enabled = false;
}

this code is not working

I will be very grateful for your help


Solution

  • You can use the enableSwipeBackNavigation property from Page.

    import { Page } from '@nativescript/core';
    
    ...
    export class AppComponent {
      constructor(
        private page: Page
      ) {
         page.enableSwipeBackNavigation = false;
      }
    }