UPDATE 2
I\'ve been running and testing my app in the iOS Simulator using a 4-inch device. If I run using a 3.5-inch device the label doesn\'t jump.
I'm seeing the same issue as described by @Danny on iOS 9. I tried updating all my constraints to that they are not constrained to the margins, but it didn't fix the issue. I ended up having to adopt a hack similar to this one as follows;
In each view controller with such an outlet, add another property for the preferred top distance. The two outlets look like this (in Swift):
@IBOutlet weak var topGuideConstraint: NSLayoutConstraint!
var topDistance: CGFloat!
In viewDidLoad(), set topDistance to the value assigned to the constraint in the storyboard:
override func viewDidLoad() {
super.viewDidLoad()
topDistance = topGuideConstraint.constant
}
In viewWillLayoutSubviews(), make sure the constraint has the proper value, adjusting for the height of the status bar when the topLayoutGuide.length is zero, which seems to be the case during the transition, but not once it's complete:
override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
topGuideConstraint.constant = topDistance + (
topLayoutGuide.length == 0
? UIApplication.sharedApplication().statusBarFrame.size.height
: 0
)
}
Repeat for every content view controller displayed in the UIPageViewController. Adjust the offset as appropriate if you're also displaying a UINavigation bar.
This is an unfortunate hack, and I hate having to do it, but after many hours trying different things, I'm at least happy to have something that works so I can move on.