Goktug
Goktug

Reputation: 923

Navigation Controller, Navigation Item and Navigation Bar

I have a view controller. I choose Editor->Embed In->Navigation Controller option. A navigation controller is added to storyboard and my view controller becomes root view controller. Besides, A Navigation Item is added at the top of my view controller.

On the other hand, we can put a navigation bar on view controllers and we can create forward backward transition between view controllers without navigation controller.

What is difference between navigation item and navigation bar ?

Upvotes: 13

Views: 9284

Answers (1)

ahbou
ahbou

Reputation: 4928

The navigation item manages the buttons (left and right) and views (mainly the title view) to be displayed in a navigation bar. Each navigation item points to a specific view controller.

The navigation bar is the container for the navigation item and mainly handles layout, transitions and animations.

You can read more about them in the official docs:

https://developer.apple.com/documentation/uikit/uinavigationitem

https://developer.apple.com/documentation/uikit/uinavigationbar

Upvotes: 19

Related Questions