Protocols in Swift
What is a Protocol?
In swift protocol is considered as a major property which we use frequently.
It basically means what are the things we are necessary to be handled. It is considered as a set of rules which are mandatory to define on using the protocol
Ex: consider a Vehicle
If we need to buy a car what are the things we take care first (speed, milage, kms) so these are the necessary things that everyone needs to know.
So, we declare all of them in a protocol
Any vehicle need to satisfy these properties(car/bus/plane)
Structure of Protocol:
Here every protocol have mandatory rules soo
Any class which conforms to this protocol need to provide definition for this.
In simple words for people who knows Java Programming Language
Protocol is just like an interface in Java
Any class which implements that interface need to provide definition.









