In a recent project I built a quick tutorial screen using a UIPageViewController. After creating all needed views and constraints I stumbled upon this awkward behaviour when changing the page:

Seems like the UIPageViewController does some strange this to the top layout guide of the contained view controllers. After trying every combination of switches in Interface Builder and some heavy stackoverflowing I fixed it using this code.

(self.topLayoutConstraint refers to the constraint defining the vertical space between the top view and the top guide)

Stay tuned for the next episode of “Philipp’s Never Ending Search For Awkward Autolayout Behaviours”.