December 2014
Beginner
300 pages
8h 9m
English
You get much more control if you use a switch statement to control your flow instead of using tons of if else statements. Swift’s switch statements are very similar to those in other languages with some extra power added in. One little caveat is that in Swift, you do not have to use break to stop a condition from running through each case statement. Swift automatically breaks on its own when the condition is met.
Another caveat about switch statements is that they must be exhaustive. That is, if you are using a switch statement on an int, then you need to provide a case for every int ever. Because this is not possible, you can use the default statement to provide a match when nothing else matches. Here is a ...
Read now
Unlock full access