You are so close to being there, except that you cannot override the static property in a subclass - that is what it means to be static . Thus, you will have to use the class property, which means that it must be a computed property - Swift does not have class properties stored.
So:
class ClassA { class var thing : String {return "A"} func doYourThing() { print(self.dynamicType.thing) } } class ClassB : ClassA { override class var thing : String {return "B"} }
And let him test it:
ClassA().doYourThing()
source share