In Swift, is there a pattern to produce the semantic equivalent of overriding a convenience initializer?
Behaviorally, this what I'd like to do:
class MyScene: SCNScene {
convenience init(URL url: NSURL, options: [String : AnyObject]?) {
super.init(URL: url, options: options)
.... other initialization
}
}
Yes, I understand initializer chaining and why you can't actually do this directly; however, it seems like a reasonable and frequently needed behavior.
Sure, I could make my own convenience initializer which does the same thing as the superclass, and calls a designated superclass initializer. But since I'm subclassing an opaque system class, I don't necessarily know how to reconstruct the behavior.
Any way to do this or a design pattern which obviates the need for this?