Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation Controller, Navigation Item and Navigation Bar

Tags:

ios

swift

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 ?

like image 894
Goktug Avatar asked Aug 17 '17 11:08

Goktug


1 Answers

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

like image 114
ahbou Avatar answered Oct 22 '22 02:10

ahbou