Posts

Showing posts from May, 2018

1.What is Delegate & Protocol in iOS?

Image
1.What is Delegate & Protocol in iOS? A. Protocol :-  1.A Protocol declares a programmatic interface that any class may choose to implement.Protocol make it possible for two classes that related by inheritance to communicate with each other to accomplish a certain goal. 2.A  Protocol  defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality. The protocol can then be  adopted  by a class, structure, or enumeration to provide an actual implementation of those requirements. Any type that satisfies the requirements of a protocol is said to  conform  to that protocol. There are two varieties of protocol  Informal Protocol : Category (Implementations are Optional) Formal Protocol : Extension (Implementations are Optional and required) 1.A formal protocol :- it declares a list of methods that client classes are expected to Implement.Its implementation requires 1.required 2.Optional methods.A form