Swift 0

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CodeWithChris Swift 4 Syntax Cheat Sheet

Variables/Constants Classes

var myVariable:DataType class myClass:Superclass {


let myConstant:DataType }

If Statements Switch

if condition { switch value to consider {


} case value:
else if condition { case value:
} default:
else { }
}

Loops Data Types

for variable in lower...upper { String


} Int
Bool
while condition { Double
} Float
Character
repeat {
} while condition

Functions

func myFunction(arg param:DataType) -> ReturnType {


}

Source: http://codewithchris.com/swift-cheat-sheet/ v1.0

You might also like