fatalError in Swift UIAlertView subclasses (unimplemented initializers)

Originator:matt
Number:rdar://20282272 Date Originated:3/24/2015
Status:Open Resolved:
Product:iOS SDK Product Version:7.1, 8.1, 8.2
Classification:Crash / Data Loss Reproducible:Always
 
Summary:
UIAlertView implicitly calls through to initializers which, if not overridden in a Swift subclass, results in a fatal error. These implicit requirements are different in both iOS 7 and 8, and in neither case do the tools tell you the implementations are expected.

Steps to Reproduce:
1) Download or clone https://github.com/drance/radars/tree/SwiftAlertDeath
2) Run the project on iOS 7 or 8. Tapping the "Show Alert" button should work fine.
3) Comment out the first override init() method, then repeat step 2 on iOS 7.
4) Comment out the second override init(frame:) method, then repeat step 2 on iOS 8.


Expected Results:
Expect no crashes, or at least a build warning that the override implementation is required.


Actual Results:
Crashes in different ways on both iOS 7 and iOS 8. Here are the respective error messages prior to crashing, for reference:

(iOS 8)
BHSAlertView.swift: 11: 7: fatal error: use of unimplemented initializer 'init(frame:)' for class 'SwiftAlertDeath.BHSAlertView'

(iOS 7)
BHSAlertView.swift: 11: 7: fatal error: use of unimplemented initializer 'init()' for class 'SwiftAlertDeath.BHSAlertView'

Version:
iOS 7.1, 8.1, 8.2. Xcode Version 6.2 (6C131e)

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!