Does swift have class level static variables? [duplicate]
Swift supports static type properties, including on classes, as of Swift 1.2:
class MyClass {
static let pi = 3.1415926
}
If you need to have a class variable that is overridable in a subclass, you'll need to use a computed class property:
class MyClass {
class var pi: Double { return 3.1415926 }
}
class IndianaClass : MyClass {
override class var pi: Double { return 4 / (5 / 4) }
}