Here is my setup (click 'setup' to see picture):
When I segue from Blue back to Green, I lose my tab bar and I can't get to Red. I think this is because the segue that I used covered the entire screen and hid the Tab Bar. What segue should I be using? Why doesn't seguing back show the Tab Bar again?
Note that I want to use a button to switch between Green/Blue
(so far, only the Show Detail
segue works) but I want to use the Tab Bar to switch between Red/Green
.
I have tried this and this but neither worked for me.
Thanks in advance,
J. Shaw
I'm not clear on how you removed the tab bar from your Blue View Controller, but the way I'm describing below removes it and it will remain on the Green View Controller when you use the back button. The result is you'll be able to move Red VC via the Tab Bar.
import UIKit
class GreenVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let destinationVC = segue.destination as! UIViewController
destinationVC.hidesBottomBarWhenPushed = true
}
}
The Storyboard: