Isuru
Isuru

Reputation: 31323

UITabBarController with UIViewControllers and UITableViewControllers

I'm creating is a Storyboard app. The Main controller is a UITabBarController.

enter image description here

When the Mail and the Documents tabs are clicked, they show the respective ViewController. However when the Mail tab is clicked, I want to display UITableViewController with a Navigation bar. Since you cannot display a Navigation bar in a UITableViewController, I found out that I must add a UINavigationController and implement a UITableViewController inside it.

Can anyone please tell me how to do that? I researched here on SO as well and came across similar questions but some of them didn't have any code examples and others were for older iOS versions(I'm using iOS 6).

Thank you.

Upvotes: 0

Views: 241

Answers (1)

Evgeniy  Gushchin
Evgeniy Gushchin

Reputation: 681

Xcode contains a great way of adding in navigation and tab bar controllers – though it’s a little bit hidden away. First, select the view controller and go to the Editor menu -> Embed In -> Navigation Controller.

Upvotes: 2

Related Questions