When an Objective-C method implements an optional protocol requirement,
allow the method to use a newer introduced or older deprecated / obsoleted
availability version than what's specified on the method in the protocol itself.
This allows SDK adopters to adopt an optional method from a
protocol later than when the method is introduced in the protocol. The users
that call an optional method on an object that conforms to this protocol
are supposed to check whether the object implements the method or not,
so a lack of appropriate if (@available) check for a new OS version
is not a cause of concern as there's already another runtime check that's required.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Do not apply this to 'deprecated' availability annotations - the user has no way to check for deprecated as respondsToSelector will still return true even if the class has marked the method as deprecated.