Swift Unable to Override Variables in Subclass

Viewed 1432

I am working on a macOS project in Swift, and I've been having a lot of trouble with overriding variables in a few classes I've made. In classTwo Xcode is presenting the error Cannot override with a stored property 'texture' on the line;

override var texture: SKTexture?

This is a bit of the code I'm using.

     public class classOne: SKSpriteNode {

        required public init?(coder aDecoder: NSCoder) {
            fatalError("init(coder:) has not been implemented")
        }
// Other functions
    }

And the second class;

    class classTwo: classOne {
        override var texture: SKTexture? // Cannot override with a stored property 'texture'

        required init?(coder aDecoder: NSCoder) {
            fatalError("init(coder:) has not been implemented")
        }
// Some other functions
    }

I do plan to actually define a specific texture for classTwo, but for now I couldn't even make this work.. Thanks in advance, and I'd appreciate any help on solving this issue!

4 Answers
Related