Stats

244 Contributors: 11
2017-01-11
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook

Switch

Download swift eBook

Parameters

ParameterDetails
Value to testThe variable that to compare against

Remarks

Supply a case for every possible value of your input. Use a default case to cover remaining input values you don't want to specify. The default case must be the last case.

By default Switches in Swift will not continue to check other cases after a case has been matched.

Related Examples