if used as an expression
Here’s the code if you want to experiment with it:
let comment = if Int.random(in: 0...3).isMultiple(of: 2) {
"It's an even integer"
} else {
"It's an odd integer"
}
Here’s the code if you want to experiment with it:
let comment = if Int.random(in: 0...3).isMultiple(of: 2) {
"It's an even integer"
} else {
"It's an odd integer"
}