Swift is an open source programming language that supports multiple programming paradigms and compiled. It was released by Apple at WWDC (Apple Developer Conference) in 2014 and is used to develop iOS, OS X and watchOS applications.

Swift combines the best of C and Objective-C without the limitations of C compatibility.

Swift can use the same running environment as Objective-C on Mac OS and iOS platforms.

Swift variables syntax

A variable is a convenient placeholder for referencing a computer memory address.

Each variable in Swift is assigned a specific type, which determines the size of the memory occupied by the variable. Different data types also determine the range of values ​​that can be stored.

Swift variables example

The following is a simple example of variable declaration in a Swift program:

import Cocoa
var varA = 42
print(varA)
var varB:Float
varB = 3.14159
print(varB)