Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a UINavigationViewController on its own

In my application which is based on a tabbar view controller with many uinavigationviewcontrollers for each tabbar items, I want to present at some point (at application launch) with a call to presentModalViewController that contains a uinavigationcontroller as a root so the user can do a few things... when he or she is finished, the Done button at the top right corner can be tapped to dismiss the modal view controller and then return to the base tabbar view.... How can I do that with Interface Builder ?

like image 966
JFMartin Avatar asked Oct 15 '22 10:10

JFMartin


1 Answers

In XCode, create a new View XIB file and open it in Interface Builder. In this xib file, delete the View and drag a UINavigationController into it's place.

Then, in your view controller code, something like

UINavigationController *controller = [[UINavigationController alloc] initWithNibName:@"ModalViewController" bundle:nil];
[self presentModalViewController:controller animated:YES];
[controller release];

Will load your XIB and present it.

Hope this helps, any other questions don't hesitate to comment on this answer!

S

like image 189
deanWombourne Avatar answered Nov 15 '22 09:11

deanWombourne