UISplitViewControllerDelegate
The methods adopted by the object you use to manage changes to a split view interface.
Declaration
@MainActor protocol UISplitViewControllerDelegateOverview
Use the methods of this protocol to respond to changes in the current display mode and to the current interface orientation. When the split view interface collapses and expands, or when a new view controller is added to the interface, you can also use these methods to configure the child view controllers.
The methods of this protocol are all optional. If you don’t implement any of the methods, the split view controller provides default behavior to handle the collapsing and expanding transitions.
For more information, see UISplitViewController.
Column-style split views
In a column-style split view interface, you use these delegate methods to customize interface transition behavior:
splitViewController(_:topColumnForCollapsingToProposedTopColumn:)
splitViewController(_:displayModeForExpandingToProposedDisplayMode:)
Classic split views
In a classic split view interface, you use these delegate methods to customize interface transition behavior:
At the end of a collapse transition, the split view controller typically shows only the content from its primary view controller. You can change this behavior by implementing the primaryViewController(forCollapsing:) method in your split view controller delegate. You might use that method to specify the secondary view controller or an entirely different view controller—perhaps one better suited for display in a horizontally compact environment.
If you want to perform any additional adjustments of the view controllers and view hierarchy, you can also implement the splitViewController(_:collapseSecondary:onto:) method in your delegate.
The expansion process reverses the collapsing process by asking the delegate to designate which view controller becomes the primary view controller and to give the delegate a chance to perform the transition itself. If you implement the delegate methods for collapsing your split view interface, you should also implement the primaryViewController(forExpanding:) and splitViewController(_:separateSecondaryFrom:) methods for expanding that interface.
Topics
Specifying the interface orientations
splitViewControllerPreferredInterfaceOrientationForPresentation(_:)splitViewControllerSupportedInterfaceOrientations(_:)
Responding to display mode changes
Collapsing the interface
splitViewController(_:topColumnForCollapsingToProposedTopColumn:)splitViewController(_:willHide:)splitViewController(_:didHide:)splitViewControllerDidCollapse(_:)
Expanding the interface
splitViewController(_:displayModeForExpandingToProposedDisplayMode:)splitViewController(_:willShow:)splitViewController(_:didShow:)splitViewControllerDidExpand(_:)
Handling the presentation gesture
splitViewControllerInteractivePresentationGestureWillBegin(_:)splitViewControllerInteractivePresentationGestureDidEnd(_:)
Collapsing and expanding classic split views
primaryViewController(forCollapsing:)splitViewController(_:collapseSecondary:onto:)primaryViewController(forExpanding:)splitViewController(_:separateSecondaryFrom:)