// if expression { // do something // } var a: Int = 3 if a == 3 { print("Hello World") } else if a < 3 { print("dlroW olleH") } else { print("42") }
let a = -5 // if the condition is true then doThis() gets called else doThat() gets called a >= 0 ? doThis(): doThat() func doThis() { println("Do This") } func doThat() { println("Do That") }