Swift 3: Protocol Part 1
Introduction: Protocol main and widely used concept in objective c and swift both. So here we will be discussing in swift. We have two parts for a protocol. Part -1, will have basic terminology and concept to understand it and Part 2 and Part 3 will have some more drills in detail about it. The protocol you can think of “Contract” between two bodies. If anyone has acquired it then, that has to follow certain rules to incorporate the action of the contract. Same way Protocol in objective will act in the same way. Protocols define the set of methods, properties, and required pieces of functionality. Any type whoever going to conform it will have to conform first and then implement the requirement. The protocol can be adopted by a class, struct, enum. Any type that fulfilling the requirement of that protocol is said to conform to that protocol. If you conform to the protocol then we need to implement the requirement. We can extend the protocol as well to extend t...