Switch Statements in SwiftUI

switch score  {

                   case 0: Image("gameboard0")
                   case 1: Image("gameboard1")

I am using a switch statement but here is the question.

Can I say something like case 0 25 49?
I am creating a board game and I would like the same picture to show when the user score is either 0, 25, or 49.

Thanks. I am sure this is fairly simple but every time I try to use an "or" statement the app crashes.

You can use comma, to use multiple patterns in a case:
Code Block
switch score {
case 0, 25, 49:
Image("gameboard0")
case 1:
Image("gameboard1")
case 26..<30, 35...40, 50...:
Image("gameboardX")
default:
Image("default")
}

Also, you can use range of Int when you need it.
Thank you. I really appreciate your help.

Switch Statements in SwiftUI
 
 
Q