Protocol

UISplitViewControllerDelegate

The UISplitViewControllerDelegate protocol defines methods that allow you to manage changes to a split view interface. 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 appropriately.

Overview

For more information about the UISplitViewController class, see UISplitViewController.

Symbols

Responding to Display Mode Changes

func splitViewController(UISplitViewController, willChangeTo: UISplitViewControllerDisplayMode)

Tells the delegate that the display mode for the split view controller is about to change.

func targetDisplayModeForAction(in: UISplitViewController)

Asks the delegate to provide the display mode to apply when a split view controller action occurs.

Overriding the Interface Orientations

func splitViewControllerPreferredInterfaceOrientationForPresentation(UISplitViewController)

Asks the delegate for the orientation to use when presenting the split view controller.

func splitViewControllerSupportedInterfaceOrientations(UISplitViewController)

Asks the delegate to specify the interface orientations that the split view controller supports.

Collapsing and Expanding the Interface

func primaryViewController(forCollapsing: UISplitViewController)

Asks the delegate to provide the single view controller to display after the split view interface collapses.

func splitViewController(UISplitViewController, collapseSecondary: UIViewController, onto: UIViewController)

Asks the delegate to adjust the primary view controller and to incorporate the secondary view controller into the collapsed interface.

func primaryViewController(forExpanding: UISplitViewController)

Asks the delegate to provide the view controller to display in the primary position when the split view interface expands.

func splitViewController(UISplitViewController, separateSecondaryFrom: UIViewController)

Asks the delegate to provide the new secondary view controller for the split view interface.

Overriding the Presentation Behavior

func splitViewController(UISplitViewController, show: UIViewController, sender: Any?)

Asks the delegate if it wants to do the work of displaying a view controller in the primary position of the split view interface.

func splitViewController(UISplitViewController, showDetail: UIViewController, sender: Any?)

Asks the delegate if it wants to do the work of displaying a view controller in the secondary position of the split view interface.

Deprecated Methods

func splitViewController(UISplitViewController, shouldHide: UIViewController, in: UIInterfaceOrientation)

Asks the delegate whether the first view controller should be hidden for the specified orientation.

Deprecated
func splitViewController(UISplitViewController, willHide: UIViewController, with: UIBarButtonItem, for: UIPopoverController)

Tells the delegate that the specified view controller is about to be hidden.

Deprecated
func splitViewController(UISplitViewController, willShow: UIViewController, invalidating: UIBarButtonItem)

Tells the delegate that the specified view controller is about to be shown again.

Deprecated
func splitViewController(UISplitViewController, popoverController: UIPopoverController, willPresent: UIViewController)

Tells the delegate that the hidden view controller is about to be displayed in a popover.

Deprecated