Swift Installation

0
175

Swift 4 is enriched with modern programming functionalities. One of them is Playground platform feature which simplifies the learning purpose. In this tutorial, we will be setting up the local environment. To start working on the Playground platform of Swift programming language, you need to have XCode software. Once you are aware of the basic concepts and terminologies of the Swift 4 then you are ready to make use of XCode IDE for the iOS and iOS X application development.

Also Read: Swift Introduction

Before we proceed ahead, make sure that you are already having an account on Apple Developer website. Now, after entering your valid credentials, visit the provided link which will take you to the webpage of Downloads for Apple Developers.

The page will appear as the following where you will be displayed with a list of all the available software.

Click on the XCode from the list and start downloading it. The file will be downloaded in the dmg format. After downloading the dmg file, double click on the downloaded file and the installation process will be initiated. You just need to follow the instructions for the complete installation process. Once done, for the final instruction you will be asked to drop the XCode icon to the Applications directory as shown in the following screenshot.

The installation of xCode is completed and now, we can proceed ahead with the Playground platform setup process. Open the Application folder, locate Xcode and open it. You will be asked to accept the terms and conditions to get along with the process. If everything goes well, the following screen will appear to you.

Click on the option of ‘Get started with a playground’ option. Now, enter the name for the playground and choose iOS as your working platform. The final Playground window will look like the following.

The window will have a default code snippet. In the above image, you can see that the code is:

import UIKit

var str = “Hello, playground”

If you would have chosen OS X program, then the same code would have appeared like this:

import Cocoa

var str = “Hello, playground”

The result of this code will appear on the result area of the Playground (on the right hand side of the window). The result will appear only after the code gets loaded. And the result would look like this:

Hello, playground

This completes your installation and Swift 4 programming environment setup.