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

Repository browser project


The RepositoryBrowser client will be created from the Master Detail template. This sets up an empty application that can be used on a large device with a split view controller or a navigator view controller on a small device. In addition to this, actions to add entries are also created.

To create a project with tests, ensure that the Include Unit Tests option is selected when creating the project:

To build the APIs necessary to display content, several utility classes are needed:

  • The URITemplate class processes URI templates with a set of key/value pairs

  • The Threads class allows functions to be run in the background or in the main thread

  • The NSURLExtensions class provides easy parsing of JSON objects from a URL

  • The DictionaryExtensions class provides a means of creating a Swift dictionary from a JSON object

  • The GitHubAPI class provides access to the GitHub remote API

URI templates

URI templates are defined in RFC 6570 at https://tools.ietf.org/html/rfc6570. They can be...