Fix problem where back swiping wouldn't work anymore for full screen. Issue #1970
This commit is contained in:
parent
41acb716bd
commit
f0ec7c5e19
@ -26,7 +26,6 @@ class InteractiveNavigationController: UINavigationController {
|
|||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
poppableDelegate.originalDelegate = interactivePopGestureRecognizer?.delegate
|
|
||||||
poppableDelegate.navigationController = self
|
poppableDelegate.navigationController = self
|
||||||
interactivePopGestureRecognizer?.delegate = poppableDelegate
|
interactivePopGestureRecognizer?.delegate = poppableDelegate
|
||||||
}
|
}
|
||||||
|
@ -5,36 +5,20 @@
|
|||||||
// Created by Maurice Parker on 11/18/19.
|
// Created by Maurice Parker on 11/18/19.
|
||||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||||
//
|
//
|
||||||
// https://stackoverflow.com/a/38042863
|
// https://stackoverflow.com/a/41248703
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
final class PoppableGestureRecognizerDelegate: NSObject, UIGestureRecognizerDelegate {
|
final class PoppableGestureRecognizerDelegate: NSObject, UIGestureRecognizerDelegate {
|
||||||
|
|
||||||
weak var navigationController: UINavigationController?
|
weak var navigationController: UINavigationController?
|
||||||
weak var originalDelegate: UIGestureRecognizerDelegate?
|
|
||||||
|
|
||||||
override func responds(to aSelector: Selector!) -> Bool {
|
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||||
if aSelector == #selector(gestureRecognizer(_:shouldReceive:)) {
|
return navigationController?.viewControllers.count ?? 0 > 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
|
||||||
return true
|
return true
|
||||||
} else if let responds = originalDelegate?.responds(to: aSelector) {
|
|
||||||
return responds
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func forwardingTarget(for aSelector: Selector!) -> Any? {
|
|
||||||
return originalDelegate
|
|
||||||
}
|
|
||||||
|
|
||||||
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
|
|
||||||
if let nav = navigationController, nav.isNavigationBarHidden, nav.viewControllers.count > 1 {
|
|
||||||
return true
|
|
||||||
} else if let result = originalDelegate?.gestureRecognizer?(gestureRecognizer, shouldReceive: touch) {
|
|
||||||
return result
|
|
||||||
} else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user