Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add more tabs in tab view controller storyboard application? [duplicate]

Tags:

Possible Duplicate:
Xcode 4.2 Tabbed Application - Adding New Tab view

I'm new to iPhone app and I followed following tutorial to develop a tab view application using story board:

It's working fine.Thanks to the Author. :)

Now, I want to add couple of more tabs to the main view(default, its 2 tabs; I want 3 or 4).

How Can I do it?

like image 528
AskMe Avatar asked Dec 11 '12 12:12

AskMe


People also ask

How do I add more tabs to my tab bar controller?

To add a tab, first drag a new View Controller object to the storybard. Next control-drag from the tab bar controller to new view controller and select view controllers under Relationship Segue . Your tab bar controller will update with a new tab.


Video Answer


2 Answers

Add one view controller (UIViewController) And Add it with your tabBarController in relationship "View Controllers"(To do this right click on tab bar controller and drag it to new view controller and select bottom most relationship seague, i.e. view controller), your XIB page should look like:

enter image description here

You can apply same pattern for the rest.

To Add Controller Files

As @Jamie Said: You have to go to the menu and click on "New File", then Objective-C class, and finally make sure to select UIViewController subclass. Name it and then it will add the files. Now in your storyboard make sure to change the class of each tab to the name of your file. i.e. to assign custom class for your ViewController this I have used Name AAA for that in Image.

like image 80
rptwsthi Avatar answered Oct 15 '22 09:10

rptwsthi


Just add one more View controller on the screen drag it from the controls, then hold the right click on tab bar controller bring that click on the newly added view controller and left the click the four options will be appear there choose the topmost option by clicking on it its name is "Relationships-view controllers" . and its done.

like image 29
iShwar Avatar answered Oct 15 '22 10:10

iShwar