Reputation: 1112
I have to create my own @protocol
and @delegation
in my interface. I read about this functionality and I understood it but I don't know the role of @required
and @optional
in @protocol
.
Why I have to use it? The @protocol
will works the same if I don't separate my methods?
Upvotes: 0
Views: 81
Reputation: 6690
@required
methods have to be implemented when a class implements a protocol, and @optional
methods do not necessary have to be implemented.
By default, all methods declared in a protocol are required methods.
Upvotes: 1