How to turn on:
1.ViewController implementation of the Uigesturerecognizerdelegate protocol
Class Yourviewcontroller:uigesturerecognizerdelegate { func viewdidload () { Navigationitem.setleftbarbuttonitems ([...,...]) Swipe back failed Self.navigationcontroller? Interactivepopgesturerecognizer.delegate = self //enable swipe back }}
If you want to disable swipe back, you can close it in Viewwillappear or viewdidappear:
Override func Viewdidappear (animated:bool) { navigationcontroller?. Interactivepopgesturerecognizer.enabled = false//disable pop gesture }
It is important to note that enabling swipe back is valid for all viewcontrollers of the current Navigationcontroller management and does not require all viewcontroller to invoke that method. Just make sure you're in the same uinavigationcontroller.
When the left edge of the custom Leftbarbuttonitem (s) slide fails