Prevent nav swipes from starting inside toolbars
This commit is contained in:
parent
43b105c85e
commit
f647402a41
|
@ -169,6 +169,13 @@ class BrowserNavigationController: UIViewController {
|
|||
|
||||
switch recognizer.state {
|
||||
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 {
|
||||
let older = backBrowserVCs.last ?? BrowserWebViewController(navigator: navigator, url: navigator.backStack.last!)
|
||||
embedChild(older, in: browserContainer)
|
||||
|
|
Loading…
Reference in New Issue