Swift Development Environment Setup

  Total Views : 208
  Comments : 0
  Keywords : Setup swift programming language development environment to build apps, Swift installation to setup playground to do programming in swift with examples

Here we will learn swift installation to setup playground platform or setup swift development environment interface using iOS xcode editor with examples.

Swift Environment Setup

Generally in swift we use playground interface to do programming for that we need to install XCode Editor which is the built-in free editor of Apple and it’s used for any type of development for apple platform like OSX Software’s, iPhones App and etc.

 

Once we are familiar with swift concepts then we can use Xcode IDE to develop applications for any type of apple platforms like OSX Software’s, iPhones App, Mac, etc.

Swift Setup Requirements

The basic requirement to install Xcode editor, we should have minimum Apple Laptop or Mac Computer for development of iOS applications using swift. We can download Xcode editor from Apple website or Apple app store and this editor is completely free we don’t need to pay anything for Apple.

Download Xcode from Apple Store

In case if you want download Xcode from Apple app store open the app store in system and search for Xcode in search bar and download it. Following is the screenshot which shows how to search Xcode and download from app store.

 

Download xcode from apple app store

Download Xcode from Apple Website

In case if you want to download the Xcode from website, we need to sign up the Apple Developer Program which is free and download the Xcode editor but remember when we are going to publish our application Apple will charge 99$.

 

Once we sign up in Apple website with Apple account and go to the Downloads section and download the Xcode Editor. Use this Download Xcode Editor URL to login and download Xcode editor.

 

If you open and login to the apple website by using above URL go to the downloads section, you will find Xcode editor to download like as shown below

 

Download ios xcode from apple developer website

 

After download click on Xcode.dmg file, just drag the Xcode and drop into the Application folder like as shown below and our Xcode installation will take 2 to 3 minutes.

 

Drag xcode and drop into application folder to install

Swift Hello World Application

Now we will see how to write simple "Hello World" program in swift with example. for that Go to Search which is in top right side at menu bar --> Click on it and search for “Xcode” and open it like as shown below.

 

Search for Xcode Editor in Apple Mac Laptop

 

Once we open Xcode the welcome window will open like as shown below. In welcome window click on the first option “Get started with a playground” to create project in swift.

 

Xcode application to create ios project

 

After selecting “Get started with a playground” a new window will open in that we need to give project name as “Hello world” and select platform as “iOS” and click on Next like as shown below.

 

Give Swift project name and select iOS platform

 

Once we click on Next button new dialog will open in that we need to select the location to save our project. Once you select the location to save project then click on Create button like as shown below

 

Select Location to Save Swift Project

 

Once we click on Create button new project will create and playground window will open like as shown below.

 

Swift Playground Interface to with Swift Hello World Example

 

Generally swift playground window will contain both input and output windows side by side like as shown above. 

 

Following is the simple “Helloworld” code written in swift playground (Left Hand Side).

 

import UIKit

print("Hello World") 

The above program will display the result like as shown below (Right Hand Side).

 

Hello World

This is how we can use swift playground to write and execute programs based on our requirements. 

 Comments (0)

Be the first to give your valuable feedback

Leave a comment

  • Default Tutlane User