Asks the delegate to provide the single view controller to display after the split view interface collapses.
- iOS 8.0+
- tvOS 9.0+
The split view controller whose interface is collapsing.
The new primary view controller to display onscreen.
When the split view controller transitions from a horizontally regular to a horizontally compact size class, it calls this method and asks you for the view controller to display when that transition is complete. The view controller you return becomes the new primary view controller of the split view interface.
Use this method to specify which view controller you want displayed in a compact environment. By default, a collapsing split view controller displays its current primary view controller but you can return a different view controller if you want. For example, you might return the secondary view controller if that view controller contains the content you want to display. You might also return a completely different view controller that is better suited for displaying content in a compact environment.
If you implement this method, you should also implement the
primary method to handle the expansion of your interface from a horizontally compact to a horizontally regular environment. If you do not implement this method, or if your implementation returns
nil, the split view controller chooses its primary view controller as the one to display.