swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.5k stars 10.35k forks source link

[SR-1981] Designated Initializer error while migrating app to Xcode 8.0 beta and Swift 2.3 #44590

Closed swift-ci closed 8 years ago

swift-ci commented 8 years ago
Previous ID SR-1981
Radar None
Original Reporter drishti (JIRA User)
Type Bug
Status Resolved
Resolution Invalid

Attachment: Download

Environment Xcode 8.0 beta and Swift 2.3
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug, swift2.3 | |Assignee | None | |Priority | Medium | md5: d0105895657f96c598d17f78390a4dee

Issue Description:

I am migrating my app from iOS 9 swift 2.0 to ios10 beta swift 2.3. I am getting Initializer does not override for the designated superclass. My controller is a subclass of MKAnnotationView.

Please refer to the screenshot attached.

belkadan commented 8 years ago

MKAnnotationView's designated initializer is init(annotation:reuseIdentifier:). The MapKit folks have now explicitly marked that in the SDK, so Swift will require you to follow their lead.

belkadan commented 8 years ago

(and it's not really something the migrator can do automatically, since it would have to understand what you were doing in your original initializer)