I have spent a fair amount of time reviewing Lesson 5 multiple times have run into 3 issues which I would greatly appreciate added clarification on:
I think of Protocols as a bridge that enables a “delegate class” to communicate with the another class that it knows nothing about (i.e. the “protocol class”); in the lesson the ViewController is delegate class and the UICollectionView is the protocol class.
If the above is correct (and, if it is not, please correct my above understanding as well) then please help me understand:
a. I understand that the “delegate class” must declare / define all the REQUIRED properties and methods of the protocol class but in reading the Apple Developer document I do not see nothing to distinguish between OPTION and REQUIRED properties and methods. Please explain how this can be done.
b. While I believe I understand Protocols (per the above) I do not understand what any of the following lines of code do and would appreciate a detailed explanation:
- Apple Development Documentation
I have – as Chris suggested – reviewed this document many times but I find it confusing in the following ways:
a. As there is a no diagram hierarchy it is very difficult to know when there is a need to use Protocols. Is there a better or an easier way to determine when their is a need to use Protocols other than tracing the inheritance of the sub classes that are being used to determine whether they “know of” / “can speak to” each other?
b. And this is big one, I find it very difficult and at times impossible to understand what is being explained in the Apple Developer document. I think – and please confirm or correct my understanding – that the programming process will be greatly were I am able to easily read and understand the Aple Developer Document. Please, what is the best and easiest way to master this skill.
Thx in advance.