Book Image

Swift Essentials

By : Alex Blewitt, Bandlem Limited
Book Image

Swift Essentials

By: Alex Blewitt, Bandlem Limited

Overview of this book

Table of Contents (16 chapters)
Swift Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a navigation controller


When there are multiple screens to be displayed, a parent controller is required to keep track of which screen is currently being shown and what the next step (or previous step) is. This is the purpose of a navigation controller; although it has no direct visual representation, it is represented as a scene in a storyboard and can affect the layout of the individual elements in the storyboard.

To embed the initial scene into a navigation controller, select the initial view and navigate to Editor | Embed In | Navigation Controller. This will create a new navigation controller view and place it to the left-hand side of the first scene. It will also change the initial view controller to be the navigation controller and set up a relationship segue with the name root view controller between the navigation controller and the first scene, represented by an icon similar to a percent symbol but with the line rotated the other way, as shown here:

It will be necessary to...