Category Archives: Swift

Introduction To Swift Programming Language

Swift is a multi-paradigm, compiled programming language created by Apple for iOS and OS X development. Introduced at Apple’s 2014 Worldwide Developers Conference (WWDC), Swift is designed to work with Apple’s Cocoa and Cocoa Touch frameworks and the large body of existing Objective-C code written for Apple products. Swift is intended to be more resilient to erroneous code (“safer”) than Objective-C, and also more concise. It is built with the LLVM compiler framework included in Xcode 6, and uses the Objective-C runtime, allowing C, Objective-C, Cpp and Swift code to run within a single program.

Syntax and Code Structure

Traditional first line code :

Variables And Constants 

In swift language var is used to create variables, and let is used to create constants.


  A constant or variable must have the same type as the value you want to assign to it. However, you don’t always have to write the type explicitly. Providing a value when you create a constant or a variable lets the compiler infer its type. In the above example, the compiler infers that “variable” is an integer because its initial value is an integer.