[Swift] UICollectionView header does not indicate conformance to NSCoding

Originator:martijn
Number:rdar://17358843 Date Originated:06/18/2014
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification:Other Bug Reproducible:Always
 
In order to perform common setup in a subclass of UICollectionView in Swift, I tried to define both init(frame:collectionViewLayout:) and init(coder:) initializers. For the latter I receive a 'Must call a designated initializer of the superclass' compiler error if I try to call super.init(coder:). It seems the strict initialization rules of Swift require explicit conformance to the NSCoding protocol for every subclass, even if a superclass already conforms to it.

The problem here is that the headers for UICollectionView don't indicate conformance to NSCoding. This may be true of more UIView subclasses, although both UIView itself and UIScrollView do.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!