Navigation controller

It creates a navigation bar for all the pages in the storyboard. It has a back button, a title and a few other custom buttons that you can add. You can customise its colour as well.

Add a navigation controller
1. Add it from the object library.
2. Drag it to a place outside the main storyboard.

Make it the first page.
1. Select the navigation controller page
2. Drag it to the left of the first scene.
3. Go to attributes inspector, scroll and hide others until you see 'Is initial view controller' and check against it.
4. Control, click and drag from navigation controller to first scene and choose 'root view controller'.
5. To set the title, click on the view controller scene and select its title bar (the one with the battery). At where the attributes inspector is, key in the title of the app.
6. To make it such that all views have the same colour in the title bar, click on 'navigation bar' under 'navigation controller' on the left hand side of the screen. Change the bar tint. Change the title colour to be a colour that matches the background.
7. Also choose a colour for the tint, which is the colour that buttons in the navigation bar will be.


You could also:
Go to editor->Embed in -> Navigation controller.

Notes
- You will not see it, but helps you to keep track.

Comments

Popular posts from this blog

Setting up a playground

Go to another page