by hawflakes · 4y ago · 0 comments
E.g.
enum Animal {
case lion
case tiger
case bear
case ohMy(Int)
}
The case `ohMy(Int)` means that it has an associated value so when you want to get at it from a variable, say: var a:Animal
switch a {
case .ohMy(let value):
// do something with `value`
...
}No comments yet.