Change the full screen tap zone to be the center of the navigation bar instead of the whole navigation bar. Issue #1450.

This commit is contained in:
Maurice Parker
2019-12-26 12:21:56 -07:00
parent 84d1ccadfd
commit 00ed368683
2 changed files with 12 additions and 20 deletions

View File

@@ -8,10 +8,6 @@
import UIKit
protocol InteractiveNavigationControllerTappable {
func didTapNavigationBar()
}
class InteractiveNavigationController: UINavigationController {
private let poppableDelegate = PoppableGestureRecognizerDelegate()
@@ -33,8 +29,6 @@ class InteractiveNavigationController: UINavigationController {
poppableDelegate.originalDelegate = interactivePopGestureRecognizer?.delegate
poppableDelegate.navigationController = self
interactivePopGestureRecognizer?.delegate = poppableDelegate
navigationBar.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapNavigationBar)))
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
@@ -44,13 +38,7 @@ class InteractiveNavigationController: UINavigationController {
}
}
@objc func didTapNavigationBar() {
if let tappable = topViewController as? InteractiveNavigationControllerTappable {
tappable.didTapNavigationBar()
}
}
}
// MARK: Private