Conforming to Protocols
suggest changeThe following syntax indicates that a class adopts a protocol, using angle brackets.
@interface NewClass : NSObject <NewProtocol>
...
@end
This means that any instance of NewClass will respond to methods declared in its interface but also it will provide an implementation for all the required methods of NewProtocol.
It is also possible for a class to conform to multiple protocols, by separating them with commas.
@interface NewClass : NSObject <NewProtocol, AnotherProtocol, MyProtocol>
...
@end
As when conforming to a single protocol, the class must implement each required method of each protocol, and each optional method you choose to implement.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents