Problem:
How can I increase the range of the swipe gesture when popping out of a navigation view? Currently swipes are only registered on a small margin from the left of the device. I would like to make the swipe be registered on the entire screen like instagram you can swipe from anywhere.
I have this code which enables swiping again after hiding the nav bar with .navigationBarHidden(true). I just cannot figure out how to increase the swiping range. Any thoughts? Thanks
extension UINavigationController: UIGestureRecognizerDelegate {
override open func viewDidLoad() {
super.viewDidLoad()
interactivePopGestureRecognizer?.delegate = self
}
public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return viewControllers.count > 1
}
}
Similar Solution: I have found this answer to the same question I can't figure out how to get it to work. There are no errors, I can't get any response unless I unhide the navbar Swipe to go back only works on edge of screen?