Provide custom relationship segues inside UIKit

Originator:matax87
Number:rdar://41247946 Date Originated:
Status:Open Resolved:
Product:UIKit Product Version:All
Classification:Enhancement Reproducible:Always
 
Summary:
Inside storyboards, when configuring container view controllers provided by UIKit, it's possible to define "relationship segues" (es. UINavigationController, UITabBarController, UISplitViewController, etc.). The key difference with these segues is that they allow a container view controller to instantiate child view controllers without loading their views, allowing the container to decide the most appropriate time to load child views.

When creating custom container view controllers, it's not possible to define relationship segues. This means that containers either have to
a) couple instantiation with loading views by using normal segues, removing a level of control over view loading
b) or, eschew segues and perform view controller instantiation and view loading in code.

The existence of relationship segues for privileged framework classes hints at the need to decouple view controller instantiation from view loading. The lack of support for relationship segues for third party code hampers the decomposition of the view controller hierarchy into smaller components, and discourages the use of storyboards for more advanced use cases.

Steps to Reproduce:
Create a storyboard with two view controllers, and attempt to create a relationship segue between them.

Expected Results:
Expected to be able to define relationships between view controllers and control view loading in the container view controller class.

Actual Results:
Only standard segues and embed segues are available.

Regression:
None

Notes:
The use of container views with “embed segues” gets close, but is still limited, because the child view controller is not available to the parent when prepareForSegue() is called. This means it's not possible for containers to configure embedded child view controllers before their view is loaded.

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!