Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does a class need to implement all of the methods in a protocol?

0
Posted

Does a class need to implement all of the methods in a protocol?

0

No. Starting with Objective-C 2.0, protocols can include the keywords @required and @optional, indicating whether a conforming object must or could supply an implementation of a method. If no keyword is specified, the method is required. The required/optional property takes effect until the next time one of the keywords appears, or the @end of the protocol definition.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123