I have a SKScene class in which I need to implement a custom initializer that override the initializer init(fileNamed: fileNamed) of the SKScene superclass SKNode, in order to do some proprietary initializations but keep the possibility offered by init(fileNamed: fileNamed) to load the scene from the interface builder.
I have some trouble to find the right syntax. I've tried the following:
class Try: SKScene
{
override init(fileNamed: String)
{
super.init(fileNamed: fileNamed)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
But it returns the error : Initializer does not override a designated initializer from its superclass
It is however a designated initializer from a superclass, not the immediate superclass which is SKEffectNode, but the one above which is SKNode. How can I override the initializer in this case ?
J.