Category Archives: Swift Overview

Swift installation

Swift installation

In this article you will find information about the how to setup local Swift programming environment. In order to setup Swift Programming environment you need to have latest version of Xcode installed installed, so if you don’t have it installed, check the following instruction to get XCode installed. If you’ve already have it installed in your system, you can skip this part.

Step 1:- Log in to the Apple Developer’s Account

Step 2:- Download the latest version of Xcode Setup from the official Apple’s website, link given below –

download-xcode-from-apple-website-for-ios-apps

Step 3:- Run the Xcode installer (the .dmg file you downloaded in the previous step.)

Step 4:- Follow the installation wizard and accept the terms and conditions to install Xcode.

Let’s create a simple “Hello World” program in Swift, Swift Playground is the easiest way to run Swift code. Swift Playgrounds allows you to interactively run the Swift code.

Step 5:- Launch the Xcode and click “Get started with a playground” in order to create a new playground

get_started_with_playgrounds

Step 6:- Enter playground name and save it.

swift-project-playground-name

Step 7:- Put the following lines of code in left hand side of the Swift Playground

Step 8:- You will see the following output in Right hand side of the Swift Playground

 

 

 

Swift Introduction

Swift Introduction

Swift is a general-purpose, multi-paradigm, object and protocol oriented programming language developed by Apple Inc. It supports the existing core concepts of Objective C like multi-threading, optional chaining, late binding with added new features like automatic memory management, protocols and introduced the protocol oriented programming. It is open source programming language developed for iOS, macOS, watchOS and tvOS. Swift is a powerful yet very easy to learn programming language. Swift syntax are very concise and expressive.

Swift Features

  • Swift is Open Source
  • Swift is much powerful, faster yet safer
  • It Supports Dynamic Library
  • It provides interactive Playgrounds and REPL in Xcode
  • It is Objective-C Interoperable

Swift History

Swift 1 :-

In October, 2014 Apple announced the swift 1.0 as the new programming language for iOS and macOS application development. Swift is being promoted as a modern, safe, fast, and interactive programming language.

Swift 2:-

In September, 2015 Apple announced the Swift 2.0 as the upgraded version of Swift at WWDC Conference along with Xcode 8 editor.

Swift 3:-

In September 2016, Apple announced the Swift 3.0 with some major code changes including enhancement in OOP Concept etc.

Swift 4:-

In September 2017, Apple announced the Swift 4.0 with some core data type enhancement in strings, subscript, etc.