Book Image

Swift Essentials - Second Edition

By : Alex Blewitt
Book Image

Swift Essentials - Second Edition

By: Alex Blewitt

Overview of this book

Swift was considered one of the biggest innovations last year, and certainly with Swift 2 announced at WWDC in 2015, this segment of the developer space will continue to be hot and dominating. This is a fast-paced guide to provide an overview of Swift programming and then walks you through in detail how to write iOS applications. Progress through chapters on custom views, networking, parsing and build a complete application as a Git repository, all by using Swift as the core language
Table of Contents (17 chapters)
Swift Essentials Second Edition
Credits
About the Author
Acknowledgments
About the Reviewer
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 the navigation controller and set up a relationship segue with the name root view controller between the navigation controller and the first scene that is represented by an icon that is similar to a percent symbol but with the line rotated the other way:

It will be necessary to move...