If I create a simple app, with 1 uiviewcontroller, and I embed it in a navigation bar, the output from the following code
override func viewDidAppear(animated: Bool) {
print ("...app height is \(UIScreen.mainScreen().bounds.height)")
print ("...win height is \(self.view.frame.size.height)")
}
results in the following:
...app height is 1024.0
...win height is 980.0
kind of makes sense, I guess, since the difference in size accounts for the height of the navigation bar, which is 44 points.
Now, I have a problem with an app that makes use of multiple storyboards, and when I transition from one storyboard to the next, the same code will return:
...app height is 1024.0
...win height is 1024.0
Strange since both storyboards have a uiview that is embedded in a navigation controller. This is causing auto layout issues, because the size of the navigation bar is not being taken into account. However, if I rotate the view or move away from it, the problem seems to resolve itself.
So, finally, the question: How do I ensure proper accounting of the navigation bar so I don't get layout issues when navigation between storyboards? I've tried forcing setNeedsDisplay() and setNeedsLayout() to no avail. Any thoughts/ideas/corrections would be appreciated.