Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode: How to add new tab screen in IOS5 storyboard?

enter image description here

I have this.. How do I add another tab screen using iOS5 storyboard, so that "Account" can have 3 screens.

Account ---> Account Listing ---> Account Details

like image 733
001 Avatar asked Apr 26 '12 13:04

001


2 Answers

You first drop in a new ViewController, and then you Ctrl-drag from the Tab Bar Controller to that new controller.

This brings up a popup where you can select "Add Relationship Segue". This connects it as a third tab.

like image 78
Thilo Avatar answered Nov 13 '22 05:11

Thilo


This can be done programmatically:

// Tab Controller
UITabBarController *tabBarController = [[UITabBarController alloc]init];

// Views to be accessed
UIViewController *controllerOne = [[UIViewController alloc]init];
UIViewController *controllerTwo = [[UIViewController alloc]init];
UIViewController *controllerThree = [[UIViewController alloc]init];

// Store UIViewControllers in array
NSArray* screenControllers = [NSArray arrayWithObjects:controllerOne, controllerTwo, controllerThree, nil];

// Add Views to Controller
tabBarController.viewControllers = screenControllers;

Or using InterfaceBuilder:

  • Adding 'Tab Bar Items' to the hierarchy of views in the left-hand panel

    enter image description here

Or using Storyboard:

iOS Storyboards (Scroll down/Search for 'Just Add It To My Tab')

like image 26
Tim Avatar answered Nov 13 '22 05:11

Tim