Learn Swift by Building Applications
上QQ阅读APP看书,第一时间看更新

Installing Xcode

First, Xcode runs on macOS only. This means you have to find a macOS-compatible computer that is running macOS 10.13 or later.

It is possible to have macOS running on a virtual machine, but having a hardware one is better.

We will install Xcode version 9.3. This is the latest version available in the App Store at the moment, but it may change in the near future, so no worries if you install a slightly newer version. The IDE looks the same way.
 
Start your computer and open the App Store application. This application is used to download extra software on to your macOS. You can find its icon on the dock, as shown here:

Once you've clicked the icon, you should see the App Store application displayed. At the top-right corner, there is a search field. Select it and start typing Xcode. You will see many suggestions as shown in the following screenshot:

Select the first item, which is what we are looking for. The next screen that will be displayed is the search result screen, something similar to this:

The only difference will be that the button will say INSTALL instead of UPDATE. Xcode is free software, provided by Apple, so you will be able to install it at no cost. Just press the INSTALL button and the download process will be triggered. The initial installation may take hours, based on your internet connection and computer speed. Don't worry—leave the computer doing its own job and you can keep reading this chapter. Once the process has finished successfully, you will see that the App Store displays another button, Open as shown in the following screenshot:

You have to click Open to start the Xcode. Another option is to find it in Applications Installed and to click on the blue icon (you have seen the icon already, while installing). The next section explores the Xcode application.