Ray Wenderlich Functions and Types Course - Part 12
Here we are! This will be to conclude Catie's course. It's been useful to go over the content. The issue is that none of it is project-based - I need to see more in context! The MOST useful way of using the info will be in the consolidation entry to follow this. So here we are, the rest on protocols and inheritance! Start Time - 12:56 Protocols and Extensions Extensions - I know about these already. Extending them to protocols... Using protocols you can say 'composition'. If class inheritance isn't quite working then protocols are the way to go! Extensions can't have stored properties or designated inits. At the moment I don't see the advantage of having extensions for a protocol when all of that could just be in one protocol. You can also extend native types e.g. Ints. This is quite advanced! extension Numeric { var squared : Self { self * self } } An example of putting in member-wise init. Challenge! Last one fo...