3
votes

In Nativescript Angular, I can swipe from left edge to right to go back on iOS. Is there any way i can detect or capture this swipe back?

The reason for this is because I have a button on screen that execute "this.routerExtensions.back()" when tapped. I would like to identify whether a "Back action" is from this button or iOS swipe event. Thanks

1
Any info on this? I want to disable the gesture as well. - Prajil Shrestha
I suppose that it's fairly simple. Just identify your button click somehow. Whatever navigation was performed you can identify if it was a button - Sergey
Is there anyway to detect the swipe back? or the navigation is by back or swipe back? - scholarwithfire

1 Answers

0
votes

NativeScript has this property on pages.

https://docs.nativescript.org/api-reference/classes/ui_page.page.html#enableswipebacknavigation

If you set that to false, you should then be able to create your own gesture for going back. Even on native iOS, I am not sure you can directly tap into the back gesture without instead replacing it with your own.