Created
December 20, 2017 06:03
-
-
Save Tinyik/3509f61f3ca2dabd57b5e2c29cc98149 to your computer and use it in GitHub Desktop.
Hide/Show UINavigationBar on push/pop, without invalidating swipe back gesture
This file contains hidden or 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
| override func viewWillAppear(_ animated: Bool) { | |
| super.viewWillAppear(animated) | |
| self.navigationController?.setNavigationBarHidden(true, animated: true) | |
| self.navigationController?.interactivePopGestureRecognizer?.delegate = nil | |
| } | |
| override func viewWillDisappear(_ animated: Bool) { | |
| super.viewWillDisappear(animated) | |
| if self.isMovingFromParentViewController { | |
| self.navigationController?.setNavigationBarHidden(false, animated: true) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment