Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Tabbed Application - Adding New Tab view

I'm working with Xcode 4.2. I started to work with Tabbed Application and now I want to add 3rd and 4th Tabbed to story board on my application. How Can I add it? I try to use it but I cannot. :( I didn't get good tutorials for it.

Does anyone have any idea how to do this?

I went through this link, but I need to add 2 more Tabbed views to first view.

Update:

Just go and create Tabbed Application and they try to add one or two more tab view. I'm still trying it. But I can't.

like image 850
Gayan Avatar asked Oct 31 '11 10:10

Gayan


People also ask

How do I add tabs to my tab bar?

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.

How do I open a new tab in Xcode?

When you hit ⌘ command + T in Xcode it will open new tab, but in the last position.

How do I create a tab view in SwiftUI?

Press Cmd+N to create a new SwiftUI View, calling it “MainView”. Creating tabs is as easy as putting different views inside an instance of TabView , but in order to add an image and text to the tab bar item of each view we need to use the tabItem() modifier.


2 Answers

Just add two more view controllers to your project, and then control drag from the tab bar controller to the view controllers to make segues to them. Make sure you select "Relationship-viewControllers" when the list pops up. Tabs will automatically be added.

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 .h and .m files. Now in your storyboard make sure to change the class of each tab to the name of your file. That's it.

like image 121
Jamie Avatar answered Sep 21 '22 18:09

Jamie


For those who are visual learners:

Create a new Tabbed Application project

enter image description here

Which will give you a storyboard like this:

enter image description here

Add new View Controller

enter image description here

Add Tab Bar Item

enter image description here

Connect to Tab View Controller

Control-drag from the Tab View Controller to the new View Controller to get the menu.

enter image description here

That's it. Watch the following video for more details.

  • Tab bar for Xcode Swift for iOS
like image 44
Suragch Avatar answered Sep 17 '22 18:09

Suragch