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

Creating new views with Interface Builder


The easiest way to create a custom view is to use Interface Builder to drag and drop the contents. This is typically done with a UITableView and a prototype table cell.

Creating a table view controller

Drag in a Table View Controller from the object library onto the main storyboard, and drag and drop from the tab bar controller to the newly created table view controller to create a relation segue called view controllers. (Segues are covered in more detail in the Storyboards, Segues , and Scenes section in Chapter 4, Storyboard Applications with Swift and iOS.)

By default, the table view controller will have dynamic property content—that is, it will be able to display a variable number of rows. This is defined in the Table View section of Attributes Inspector, which can be displayed by selecting Table View from the scene navigator and then pressing Command + Option + 4:

Note

There is an option for tables to have static content; a fixed number of rows in...