8.2 Using the switch Statement Syntax
The syntax for a basic Swift switch statement implementation can be outlined as follows:
switch expression
{
case match1:
statements
case match2:
statements
case match3, match4:
statements
default:
statements
}
In the above syntax outline, expression represents either a value, or an expression which returns a value. This is the value against which the switch operates.
For each possible match a case statement is provided, followed by a match value. Each potential match must be of the same type as the governing...