I am working on a SpriteKit game using Swift and I need to subclass SKSpriteNode. In the init() (which is not an override) function I initialize the subclass's properties then call the super:
init(selector: Selector, delegateScene: SKScene, text: String, position: CGPoint) {
self.delegateScene = delegateScene
self.labelNode = SKLabelNode()
self.labelNode.position = CGPointZero
self.labelNode.text = text
self.selector = selector
super.init()
}
I set a breakpoint at the super.init() and a EXC_BAD_INSTRUCTION exception occurs right after it at the beginning of the subclass's init. Here's the error:
(file path).swift: 12: 7: fatal error: use of unimplemented initializer 'init(texture:color:size:)' for class 'Energies.Button'