Jeff Wolski
Jeff Wolski

Reputation: 6372

Putting a UITabViewController inside UINavigationViewController with storyboard

I'm using a storyboard to to lay out my app, and I would like to put a UINavigationController as my root and then UITabViewController as the root of that. The main reasons I'm doing this are to save memory and to reduce the complexity of the controller tree.

So, is this an ok practice, and will this result in a more memory-efficient app than putting a separate nav controller in each tab?

Upvotes: 0

Views: 632

Answers (3)

Jeff Wolski
Jeff Wolski

Reputation: 6372

Ok, I found the answer.

This question is regarding combining tab and navigation controllers while using a storyboard. Here's a tutorial that that addresses this situation.

http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1

Upvotes: 0

saurb
saurb

Reputation: 685

According to apple documentation. The tab bar controller should always be your root controller in this case. Here is a tutorial on how to put a navigation controller inside of a tab bar controller.

Upvotes: 1

Kerri Shotts
Kerri Shotts

Reputation: 2372

Your UITabBarController should come first in the hierarchy, followed by your UINavigationController, and then your views. I would not worry terribly much about memory here: your app should already do the right things when iOS is low on memory (release what you can; rebuild it when requested by the user).

Upvotes: 0

Related Questions