Changes

The Swift Switch Statement

31 bytes added, 04:19, 10 November 2016
Combining case Statements
<htmlet>ios10</htmlet>
== Combining case Statements ==
<htmlet>adsdaqbox_flow</htmlet>
In the above example, each case had its own set of statements to execute. Sometimes a number of different matches may require the same code to be executed. In this case, it is possible to group case matches together with a common set of statements to be executed when a match for any of the cases is found. For example, we can modify the switch construct in our example so that the same code is executed regardless of whether the value is 0, 1 or 2: