Swift Switch

[Solved] Swift Switch | Swift - Code Explorer | yomemimo.com
Question : switch case in swift language

Answered by : muhammad-zeeshan-vdbiet6jzy1z

let liveAlbums = 2
switch liveAlbums {
case 0: print("You're just starting out")
case 1: print("You just released iTunes Live From SoHo")
case 2: print("You just released Speak Now World Tour")
default: print("Have you done something new?")
}

Source : https://www.hackingwithswift.com/read/0/10/switch-case | Last Update : Thu, 03 Mar 22

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

Answers related to swift switch

Code Explorer Popular Question For Swift