I have a UIViewController (with a hidden UINavigationController) which contains a UIButton. Clicking the button calls instantiateViewControllerWithIdentifier on another UIViewController (and passes the second UIViewController some data).
Try as I might, I could not get the second UIViewController to display its UINavigationController navigationBar, even though I had it embedded in the UINavigationController. That's not a catastrophe, though, because I didn't really want it there anyway and would have simply hidden it. I added a UIButton to the second UIViewController and control-click-dragged in Interface Builder to add a "Show" segue back to the first UIViewController.
But now when you visit any other UIViewController (and only after following the steps above), the UINavigationBar is missing.
Here's how I'm loading the second UIViewController:
let destinationViewController = self.storyboard?.instantiateViewControllerWithIdentifier("viewGold") as! SecondViewController
destinationViewController.results = result
self.presentViewController(destinationViewController, animated: true, completion: nil)
So:
- Is it terrible of me to want to not display the UINavigationBar on two of the UIViewControllers?
- Am I loading the SecondViewController correctly?
- Is there a way to mimic clicking a "Back" UINavigationBar in the UIButton click of the SecondViewController?