Why are almost all iOS SDK delegate options optional?

I understand the pros and cons of the optional and necessary delegation methods. But I was amazed at how several iOS delegate methods are required. Is there any wisdom that the designers of the iOS SDK do not have? Is there something they are trying to avoid that I don’t see?

Thanks in advance.

+5
source share
1 answer

The simplest answer is that most programs will not use most delegate methods, so instead of developers creating empty methods that are not used, methods are assigned as optional and can only be used when you need them. The reason is because there are so many methods, because the SDK developers have provided many things you can do that are necessary for a reliable device such as a smartphone.

+5
source

All Articles