Appboy / appboy-ios-sdk

Public repo for the Braze iOS SDK
https://www.braze.com
Other
165 stars 142 forks source link

Enable subclass in Swift #300

Closed kushalpal17 closed 2 years ago

kushalpal17 commented 3 years ago

Trying to subclass ABKContentCardsTableViewController in Swift results in the compiler error: Must call a designated initializer of the superclass 'ABKContentCardsTableViewController'

Swift is not properly inferring the designated initializers, so trying to call super.init() results in an error, as does calling super.init(delegate:). Placing the signatures for init and initWithCoder: in the public header and marking them with NS_DESIGNATED_INITIALIZER seems to do the trick.

mattlsteinberg commented 2 years ago

Hi @kushalpal17, thank your for submitting this PR! Our team is unable to reproduce the error on our end.

Could you please let us know if you’re currently able to reproduce it on Xcode 13 with Swift 5.5? We're going to close this for now, but please re-open it if the error is ongoing in those versions.