Answers for "swift if statements"

1

swift 5 if statement

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")
}
Posted by: Guest on April-08-2020
0

swift else if

if (condition1) {
    // code block 1
}

else if (condition2){
    // code block 2
}

else {
    // code block 3
}
Posted by: Guest on June-12-2021

Code answers related to "Swift"

Browse Popular Code Answers by Language