Been looking around on here for a while but can\'t seem to find a working solution.
I\'m trying to disable the swipe to go back to previous view gesture, in Swift.>
I generally make sure that swipe back is enabled in as many places as possible, even adding a custom gesture recognizer to add it to modal screens. However for an authentication and download process in my app I start the process with a modal navigation controller and then push the view for each next step. However, once it's completed I want to prevent them from backing up into the authentication screens.
For this scenario I've been using:
navigationController?.interactivePopGestureRecognizer?.isEnabled = false
navigationItem.hidesBackButton = true
in viewWillAppear()
on the final screen. You can undo these in viewWillDisappear()
if you're pushing another view and need them there.