Protocol: UISplitViewControllerDelegate
Overview
The UISplitViewControllerDelegate protocol defines methods that allow you to manage changes to the visible view controllers in a split view controller. When the split view controller rotates between portrait and landscape orientations, it hides or shows the first view controller in its array of view controllers. When the view controller is hidden, it is standard practice to add a button to the toolbar of the remaining view controller that, when tapped, displays the hidden view controller in a popover. The methods of this protocol provide you with the information you need to add and remove this button at the appropriate times.Tells the delegate that the hidden view controller is about to be displayed in a popover.Asks the delegate whether the first view controller should be hidden for the specified orientation.Tells the delegate that the specified view controller is about to be hidden.Tells the delegate that the specified view controller is about to be shown again.
Instance Method Summary (collapse)
-
- splitViewController:popoverController:willPresentViewController:
Tells the delegate that the hidden view controller is about to be displayed in a popover.
-
- splitViewController:shouldHideViewController:inOrientation:
Asks the delegate whether the first view controller should be hidden for the specified orientation.
-
- splitViewController:willHideViewController:withBarButtonItem:forPopoverController:
Tells the delegate that the specified view controller is about to be hidden.
-
- splitViewController:willShowViewController:invalidatingBarButtonItem:
Tells the delegate that the specified view controller is about to be shown again.
Instance Method Details
- (Object) splitViewController(svc, popoverController:pc, willPresentViewController:aViewController)
Tells the delegate that the hidden view controller is about to be displayed in a popover. The toolbar button you add to your user interface facilitates the display of the hidden view controller in response to user taps. When the user taps that button, the split view controller calls this method. You can use this method to perform any additional steps prior to displaying the currently hidden view controller.
- (Boolean) splitViewController(svc, shouldHideViewController:vc, inOrientation:orientation)
Asks the delegate whether the first view controller should be hidden for the specified orientation. The split view controller calls this method only for the first child view controller in its array. The second view controller always remains visible regardless of the orientation. Prior to iOS 5.0, the first view controller was always hidden in portrait orientations and always shown in landscape orientations. If you do not implement this method in your delegate object, that default behavior remains in effect.
- (Object) splitViewController(svc, willHideViewController:aViewController, withBarButtonItem:barButtonItem, forPopoverController:pc)
Tells the delegate that the specified view controller is about to be hidden. When the split view controller rotates from a landscape to portrait orientation, it normally hides one of its view controllers. When that happens, it calls this method to coordinate the addition of a button to the toolbar (or navigation bar) of the remaining custom view controller. If you want the soon-to-be hidden view controller to be displayed in a popover, you must implement this method and use it to add the specified button to your interface.
- (Object) splitViewController(svc, willShowViewController:aViewController, invalidatingBarButtonItem:button)
Tells the delegate that the specified view controller is about to be shown again. When the view controller rotates from a portrait to landscape orientation, it shows its hidden view controller once more. If you added the specified button to your toolbar to facilitate the display of the hidden view controller in a popover, you must implement this method and use it to remove that button.