Question : Swift switch Statement
Answered by : samer-saeid
switch (expression) { case value1: // statements case value2: // statements ... ... default: // statements
}
Source : | Last Update : Wed, 22 Jun 22
Question : Swift Tuple in Switch Statement
Answered by : samer-saeid
let info = ("Dwight", 38)
// match complete tuple values
switch info { case ("Dwight", 38): print("Dwight is 38 years old") case ("Micheal", 46): print("Micheal is 46 years old") default: print("Not known")
}
Source : | Last Update : Wed, 22 Jun 22