Stephen DeStefano Swift 5 Course - Part 7 (Lectures 26 to 31)
So continuing with Control Flow! Going to do approximately an hour now - so that will be the rest of this chapter, then the next one on Strings. Start Time - 13:20 If/else Just a catch up on this - skimming through! Simple example above. The use of else if as the alternative cases. Nested if statements - having an if statement with one that follows immediately. Simple. Switch Statements Again, I'm happy with this. Has to be exhaustive, is better for situations with numbers. Using several values for different cases - And this is with number ranges - Tuples with switch statements - Again, straightforward stuff. You just need to do the case with two values (as there are two - cars and weeks). In the above, there are closed values, the wildcard bit (underscore used). You can also use value binding by creating a value within the case - So you then use those temp values that have been binned within the print statements. Where clause - can be u...