Book Image

Swift 2 Blueprints

By : Cecil Costa
Book Image

Swift 2 Blueprints

By: Cecil Costa

Overview of this book

In this book, you will work through seven different projects to get you hands-on with developing amazing applications for iOS devices. We start off with a project that teaches you how to build a utility app using Swift. Moving on, we cover the concepts behind developing an entertainment or social networking related application, for example, a small application that helps you to share images, audio, and video files from one device to another. You’ll also be guided through create a city information app with customized table views, a reminder app for the Apple Watch, and a game app using SpriteKit. By the end of this book, you will have the required skillset to develop various types of iOS applications with Swift that can run on different iOS devices. You will also be well versed with complex techniques that can be used to enhance the performance of your applications.
Table of Contents (15 chapters)
Swift 2 Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the app


Let's start creating the app by opening Xcode and creating a new, single-view application project. Call it Chapter 3 Photo Sharing and select Swift as its main language.

Before coding, we have to set the app configuration. In this case, we will set this app to be used only in the portrait mode. Click on your project, select the app target, and leave only the Portrait orientation checked.

Rename the ViewController.swift file to InitialViewController.swift and do the same with its class. Don't forget to change the view controller's class on the storyboard.

Taking advantage of being on the storyboard, we can complete the layout of the first scene. This first scene just needs a title (a label), some user instructions (a text view), and two buttons: one to take a picture from the camera roll and another one to take a picture from the camera. Don't forget to add the autolayout constraints so it can be adapted to any screen size. The final layout will be similar to the following screenshot...