How to disable swipe to navigate Back in iOS

Posted by Jennifer | Updated on

In this answer, I have shared how to disable swipe to navigate Back in iOS? I have one additional point here. I was just solving this problem, but I also needed my user to be able to go back by pressing the “native” back button on the AppBar (did not want to reimplement AppBar just because of this), and I found this niche little flag: userGestureInProgress on the Navigator object, so what I use (and presume is the preferred way) is:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers