Reputation: 194
I have a standard UINavigationController for an iOS application in Swift 5 in which I'd like to hide the Navigation Bar on the first ViewController in the stack.
My storyboard is essentially:
UINavigationController -> ViewControllerA -> ViewControllerB
with simple Show segues.
In ViewControllerA I put the following:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.isHidden = true
}
In ViewControllerB I put the following:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.isHidden = false
}
But in the simulator the transition from A->B presents this weird, like, "scooping" animation and I cannot figure out how to get rid of it.
Thoughts? Thank you in advance!
Upvotes: 0
Views: 373
Reputation: 385
There's another method for hiding the navigation bar where you can set 'animated' to false which might help you.
self.navigationController?.setNavigationBarHidden(true, animated: false)
Upvotes: 1