I love the swipe pack thats inherited from embedding your views in a UINavigationController
. Unfortunately i cannot seem to find a way to hide the Naviga
My solution is to directly extend the UINavigationController
class :
import UIKit
extension UINavigationController: UIGestureRecognizerDelegate {
override open func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.interactivePopGestureRecognizer?.delegate = self
}
public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return self.viewControllers.count > 1
}
}
This way, all navigation controllers will be dismissable by sliding.