lightweight generics in objective c
Objective-C generics really are lightweight, and were added to improve interoperability with Swift, not to make Objective-C code safer. Similar to nullability, think of generics as a way to annotate your interface rather than a reason to change your implementation.
Changing ObjectType
to id
in the implementation is the best way forward.
Further reading: article on Objective C Generics. Read bob’s comment on that article if you want to know about __covariant
.