Swift 4 EXC_BAD_ACCESS Crash when subclassing UICollectionViewController

Originator:matt.versteeg
Number:rdar://34440339 Date Originated:11/14/2017
Status:Open Resolved:
Product:Swift Product Version:4
Classification:Bug Reproducible:Always
 
Area:
UIKit

Summary:
Consider classes with the following inheritance structure:
UICollectionViewController <- ParentVC <- ChildVC

The app will hard crash with EXC_BAD_ACCESS with no stack dump or supplementary information if collectionView(....insetForSectionAtIndex....) is implemented in ParentVC but _not_ overridden in ChildVC, or if it is _only_ implemented in ChildVC.  

Steps to Reproduce:
Instantiate a subclass of a UICollectionViewController subclass in which the insetForSectionAtIndex is _only_ defined in one of the files.  

Expected Results:
App will not crash, and insets will be set according to the rules of inheritance.

Actual Results:
EXC_BAD_ACCESS exception

Version/Build:
Swift 4, XCode 9 GM Seed

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!