I want
view controller 1: tab bar is showed
view controller 2: tab bar is showed
view controller 3: tab bar is not showed.
I wrote
// prepareForSegue in view controller 1,
let upcoming = segue.destinationViewController as! viewcontroller3
upcoming.hidesBottomBarWhenPushed = true
// prepareForSegue in view controller 3,
let upcoming = segue.destinationViewController as! viewcontroller2
self.hidesBottomBarWhenPushed = true
When I go to view controller 3 from view controller 1, tab bar is not showed. Then, I go to view controller 2 from view controller 3, tab bar is showed. But when I tap back in view controller 2, tab bar is showed in view controller 3. self.hidesBottomBarWhenPushed = true
does not make sense to me. But, I couldn't figure what I should do to fix that. Any suggestions? Thanks.
Edit: That solved the problem.
It makes sense that the tab bar is appearing because when going clicking back from VC2 to VC3, nothing is telling VC3 to hide its Tab Bar.
I think you have 2 solutions here (but haven't tested any):
self.tabBarController?.tabBar.hidden = true
in ViewDidLoad
or viewWillAppear