Day 11 of 100 days of SwiftUI
Day 11 - I didn’t have time yesterday to cover it. The focus has been Protocols. Did I understand it? Not really - I’ve understood the basics but not enough to even consistently get the quizzes correct. I’m persevering though through to the days when I can start putting it together in a programme.
Protocols describe what methods and properties a conforming type must have, but don’t provide the implementations of those methods.
You can build protocols on top of other protocols, similar to classes.
Extensions let you add methods and computed properties to specific types such as Int.
Protocol extensions let you add methods and computed properties to protocols.
Protocol-oriented programming is the practice of designing your app architecture as a series of protocols, then using protocol extensions to provide default method implementations.