Created
June 12, 2019 06:26
-
-
Save yojkim/adfe9ca363fba86b7e1b53677e5007ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UINavigationController: UINavigationControllerDelegate { | |
open override func viewDidLoad() { | |
super.viewDidLoad() | |
self.delegate = self | |
} | |
public func navigationController( | |
_ navigationController: UINavigationController, | |
didShow viewController: UIViewController, | |
animated: Bool) | |
{ | |
if self.viewControllers.count > 1 { | |
self.interactivePopGestureRecognizer?.isEnabled = true | |
} else { | |
self.interactivePopGestureRecognizer?.isEnabled = false | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment