lowerkey
lowerkey

Reputation: 8335

Do I need a UINavigationController?

I'm building my very first iPhone application. It's pretty simple, I'm displaying two lists the user can switch between using a tabbar.

I'm unfamiliar with the IB, so I'm building the UI from scratch, hoping to learn a thing or two about the inner workings that would otherwise be hidden.

My question for SO is: Do I need a UINavigationController? There are no levels of navigation to this (yet), so the navigation stack described here seems excessive.

What's SO's advice?

Upvotes: 1

Views: 229

Answers (3)

Jason Cragun
Jason Cragun

Reputation: 3233

Well......... no you dont need one. But yes, I would take the time to use one. The UINavigationController and the UITableViewController are the two most used controllers in the iphone SDK. Better get to know them if you want to be an IOS programmer.

Also.. you said that you dont need "levels of navigation... yet". Better do it right from the beginning or you will be redoing all your code later on.

just my two pesos.

Upvotes: 2

Ken Pespisa
Ken Pespisa

Reputation: 22264

Short answer: You don't need a UINavigationController.

Longer less definitive answer: Since you are just starting out I wouldn't mess with the UINavigationController just yet. Get comfortable with the UITabController and the two view controllers you need to show on each tab.

At some point, though, you may want to consider experimenting with the UINavigationController as you may find you want something to happen when a user taps on a list item within one of those lists. Perhaps you'll want to show more detail at that point, show a map, or a form, etc. That's when the UINavigationController is going to come in handy.

Upvotes: 3

Ryan Wersal
Ryan Wersal

Reputation: 3228

If you have two completely separate views, a UITabBar would be the far better pick.

This just shows a "ribbon" of sorts at the bottom of the screen which allows for choosing an option. The UITabBar is generally used for switching completely unrelated views, such as your use case.

On the other hand, a UINavigationController is used to form a tree-like hierarchy or drilldown and is ill suited for your use case.

Upvotes: 1

Related Questions