Prevent nav swipes from starting inside toolbars

This commit is contained in:
Shadowfacts 2020-12-20 14:19:26 -05:00
parent 43b105c85e
commit f647402a41
1 changed files with 7 additions and 0 deletions

View File

@ -169,6 +169,13 @@ class BrowserNavigationController: UIViewController {
switch recognizer.state { switch recognizer.state {
case .began: case .began:
// swipe gestures cannot begin in navbar/toolbar bounds
let min = view.convert(navBarView.bounds, from: navBarView).maxY
let max = view.convert(toolbarView.bounds, from: toolbarView).minY
if toolbarOffset == 0 && (location.y < min || location.y > max) {
return
}
if location.x < startEdgeNavigationSwipeDistance && velocity.x > 0 && navigator.backStack.count > 0 { if location.x < startEdgeNavigationSwipeDistance && velocity.x > 0 && navigator.backStack.count > 0 {
let older = backBrowserVCs.last ?? BrowserWebViewController(navigator: navigator, url: navigator.backStack.last!) let older = backBrowserVCs.last ?? BrowserWebViewController(navigator: navigator, url: navigator.backStack.last!)
embedChild(older, in: browserContainer) embedChild(older, in: browserContainer)