Basic usage of UISplitViewController
In the afternoon, I got a sample code for pover, And I just used UISplitViewController. I haven't used this stuff too much, so I should sort it out and consolidate it.
1. Several Important attributes (in fact, there are only a few)
(1) viewControllers attribute, type NSArray.
Two UINavigationController objects are referenced here. The first is the master menu controller of UISplitViewController, and the second is the detail controller. You must set these two navigation controllers first.
(2) presentsWithGesture attribute, bool type.
This is set to yes. When the screen is portrait, you can call out the menu bar through gestures. The default value is yes.
(3) The third is the proxy property. I have nothing to say about it. Generally, I set the detail control as a proxy.
2. Several required proxy Methods
(1)
-(Void) splitViewController: (UISplitViewController *) svc willHideViewController :( UIViewController *) aViewController withBarButtonItem :( UIBarButtonItem *) barButtonItem forPopoverController :( UIPopoverController *) popoverController
The proxy method is called when the device is converted to a portrait screen and the menu bar is hidden.
AViewController is the controller reference in the menu bar.
BarButtonItem is the navigation bar button on aViewController.
PopoverController indicates that aViewController is displayed in this popover.
(2)
-(Void) splitViewController :( UISplitViewController *) svc popoverController :( UIPopoverController *) pc willPresentViewController :( UIViewController *) aViewController
When the screen is portrait, the interface method is called to call the hidden menu bar.
(3)
-(Void) splitViewController: (UISplitViewController *) svc willShowViewController :( UIViewController *) aViewController invalidatingBarButtonItem :( UIBarButtonItem *) barButtonItem
When the device is rotated to a horizontal screen, this proxy method is called when the menu bar is displayed.
Well, this UISplitViewController should be quite simple to use. Let's do it first ······
Reprinted please indicate the source: Blog: Yan Feng zhicao Jin Author: away