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...