In the first recipe, we will set up our development environment and use Swift Playgrounds to create our first piece of Swift code.
Getting ready
First, we must download and install Apple's IDE, Xcode, from the Mac App Store:
- Open up the Mac App Store, either from the Dock or via Spotlight:
Figure 1.1 – App Store
- Search for xcode:
Figure 1.2 – Searching for xcode
- Click on GET, followed by Install:
Figure 1.3 – Xcode in the App Store
Xcode is a large download (nearly 8 GB), so this may take a while, depending on your internet connection.
- Once downloaded, open Xcode from the App Store or the Dock:
Figure 1.4 – Opening Xcode
How to do it...
With Xcode downloaded, let's create our first Swift playground:
- Launch Xcode from the icon in your Dock.
- Choose Get started with a playground from the welcome screen:
Figure 1.5 – Xcode, new project
- Select Blank from the iOS tab of the template and then press...