/ Published in: Objective C
As default UISplitViewController has to be the root controller. In this snippet, you can have one as a child of a UINavigationController and also an UIToolbar above the SplitViewController! The same as Epicurious app for iPad.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Define rootController as a UINavigationController, then...: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Sets up toolbar above splitview rootController.navigationBar.hidden = YES; CGFloat width = rootController.view.frame.size.width; toolbar = (Toolbar *)[nib objectAtIndex:0]; toolbar.frame = CGRectMake(0,20,width,TOOLBAR_HEIGHT); [rootController.view addSubview:toolbar]; UISplitViewController *splitViewConntroller = [[UISplitViewController alloc] init]; leftViewController = [[LeftViewController alloc] initWithNibName:@"LeftViewController" bundle:nil]; [array addObject:leftViewController]; rightViewController = [[RightViewController alloc] initWithNibName:@"RightViewController" bundle:nil]; [array addObject:rightViewController]; [splitViewConntroller setViewControllers:array]; [splitViewConntroller release]; [window addSubview:rootController.view]; [window makeKeyAndVisible]; return YES; }