Showing posts with label get Used to with Swift. Show all posts
Showing posts with label get Used to with Swift. Show all posts

Sunday, 28 September 2014

Learning Swift with iOS 8 tutorials part 1

What is Swift ?

Swift is Apple's latest programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. Swift adopts safe programming patterns and adds modern features to make programming easier, and flexible.

The Basics:
Swift Providing below data types in his way of syntax. 

Int             : Used for integer type values.
Double      : Used for floating points values.
Float         : Used for floating points values.
Bool          : Used for Boolean values.
String        : Used for Text data values
Array         : Used for collection.
Dictionary  : Used for collection.


Constants and Variables
In Swift, Constants and Variables need to be declared first before using them.

let  x = 10
var y = 0

You can declare multiple constants and variables in a single line using coma as a separator.
let x = 10, y=11,z=0
var  a = 1, b=10, c=3