-
Notifications
You must be signed in to change notification settings - Fork 167
Description
Motivation
I was reading the UICollectionViewDataSource documentation and when I clicked on the link to the collectionView(_:numberOfItemsInSection:) method, I saw "Instance Method" at the top which led me to be confused whether the UICollectionViewDataSource was a class or a protocol (it is a protocol).
The documentation does not distinguish between instance methods of classes vs protocols. For example, the documentation for the dequeueConfiguredReusableCell method identifies this method as an instance method as well.
Further, the documentation is clear:
Protocols can require specific instance methods and type methods to be implemented by conforming types.
The documentation also refers to methods that a protocol enforces as required as a "method requirement", or properties that a protocol enforces as required as "property requirements". The following example defines a protocol with a single instance method requirement: See "Here’s an example of a protocol with a single instance property requirement:", link.
Proposed solution
The description above the the title of the required method name of a protocol should clearly say "Required by Instance", "Required Instance Method", or "Method Requirement". Similarly, for a required property name of a protocol, the documentation should read "Required by Instance", "Required Property Method" or "Property Requirement". This is in line with how method requirements and instance properties are referred to in the documentation, and more importantly, reduces the amount of confusion that is caused when one is reading documentation about required methods for classes vs required methods for protocols.
Alternatives considered
No response
Additional information
No response