Every switch statement consists of multiple possible cases, each of which begins with the
case keyword. In addition to comparing against specific values, Swift provides several
ways for each case to specify more complex matching patterns. These options are
described later in this section.
The body of each switch case is a separate branch of code execution, in a similar manner to
the branches of an if statement. The switch statement determines which branch should be
selected. This is known as switching on the value that is being considered.
Every switch statement must be exhaustive. That is, every possible value of the type being
considered must be matched by one of the switch cases. If it is not appropriate to provide a
switch case for every possible value, you can define a default catch-all case to cover any
values that are not addressed explicitly. This catch-all case is indicated by the keyword
default, and must always appear last.
This example uses a switch statement to consider a single lowercase character called
someCharacter: