In the Protocol-Oriented approach, we start designing our system by defining protocols. We rely on new concepts: protocol extensions, protocol inheritance, and protocol compositions. The paradigm also changes how we view semantics. In Swift, value types are preferred over classes. However, object-oriented concepts don’t work well with structs and enums: a struct cannot inherit from another struct, neither can an enum inherit from another enum. In this tutorial, you’ll explore the ways you can create and use protocols, as well as use protocol-oriented programming patterns to make your code more extensible.
Code Example: https://github.com/nishiths23/POPDemo
Nishith Singh is from BookMyShow with 4.5 yrs of exp in iOS industry. He has immense interest & worked with RxSwift, HLS, Image & Video processing & many more. Further, he likes to travel and is a gym freak.
Presented at Swift Mumbai - Chapter #4 Meetup: https://www.meetup.com/Swift-Mumbai/events/250189683/