unlike class
var, where they can overridden in subclasses, I believe same applies to static
as well but unfortunately not. Here\'s an example
You can have computed class properties:
public class A {
class var NAME: String {
return "A"
}
}
public class B {
class var NAME: String {
return "B"
}
}
If need be, you could even "branch" to a stored property in the subclass:
public class A {
// Needs to be overriden in subclass
class var NAME: String {
return "A"
}
}
public class B {
class var NAME: String {
return B.storedName
}
static var storedName: String = defineName()
func defineName() -> String {
// You could do something more complex here
return "B"
}
}