UIPageViewController should have an option to change the spine location based on the size class

Originator:michaelhochs
Number:rdar://38616727 Date Originated:19-Mar-2018 01:43 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:11
Classification:Enhancement Reproducible:Always
 
Summary:
UIPageViewController currently is able to change its spine location based on the interface orientation through a delegate call to `pageViewController:spineLocationForInterfaceOrientation:`. This is super great for interface orientations, but thinking about why it would need to change its spine location (and therefore ultimately the number of child VCs shown at the same time), the most likely case is that it should change the spine because the width of the display changes together with the orientation and there are screen sizes that better match a single page and others than better match two pages.

Now for a while now there is a nicer interface to accommodate for this: size classes. The same size change can happen by putting a second app next to the current one in multitasking split screen, e.g. with a 50:50 split. In this case, the same reasoning applies: switching from a double page to a single page layout when switching into 50:50 split screen makes sense. Therefore `UIPageViewController` should get a new delegate method `pageViewController:spineLocationForTraitCollection:`.

Even more flexible would be to instead make `spineLocation` writable and let this be changeable at any time. This way it could be set during a trait collection change, during a size change, and any other event, simply by subclassing `UIPageViewController` and overriding the methods in question.

Steps to Reproduce:
-

Expected Results:
-

Actual Results:
-

Version:
11

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!