jazzedge
12/2/2017 - 6:13 AM

Swift - Delegates and Protocols

See: https://makeapppie.com/2016/09/23/why-do-we-need-delegates-in-ios-and-watchos/
See: https://makeapppie.com/2016/06/27/using-segues-and-delegates-for-navigation-controllers-in-swift-3-0/



Delegation uses protocols. Protocols are a set of  properties and methods that while declared in one place, another class implements. They allow for a layer of abstraction. A class adopts a protocol to do something. The protocol defines what the something is.  The adopting class will have the code how it gets done.