Bob Lee Course Part 4 (lesson 7)
Back with Bob! Error Handling makes a lot more sense to me now. In my mind, you have if/let, guard/let and the ?? options to see if optionals have a value. Also, you can build in specific error handling options with a enum with messages, which follow the Error protocol. Then the do/try/catch block of code is used to test for errors. Error handling can also be built in to functions, to test for an error and also in classes within the initialisation. Like I said, I know a lot more this time round when I did EH with Treehouse! Right let's go! Start time - 12:20 Type Casting It's useful to start with the 'problem' Bob describes, to give this some sort of focus - So the keyword 'as' I've used before, but I can't remember how! Here's an example with 'as' let label = UILabel () as UIView class Human { func introduce() { print ( "I am a human" ) } } class Korean: Human ...