This seems to be happening because UIPageViewController
's view (which is actually a _UIPageViewControllerContentView
) doesn't handle subviews and autolayout as expected (at least in iOS 7; it worked fine for me in iOS 8).
You can get around this by not using autolayout, but I wanted to use autolayout so I ended up redoing my view controllers to avoid adding subviews to UIPageViewController
.
Instead of subclassing UIPageViewController
, I created a container view controller (a subclass of UIViewController
) with a UIPageViewController
as a child view controller. The custom subviews that I initially had in UIPageViewController
were then added to the container's view
. I also made the container the data source and delegate for the UIPageViewController
.
There's a related thread where people got the same assertion failure but with a UITableViewCell
: "Auto Layout still required after executing -layoutSubviews" with UITableViewCell subclass. Most of the suggestions there don't work or aren't applicable to UIPageViewController, but it helped me figure out why adding subviews with autolayout might cause a problem.