"For class instances, a constant property can only be modified during initialization by the class that introduces it. It cannot be modified by a subclass."-《The Swift Programming Language》
If I want to inherit a constant from super class and modified during subclass init.I konw it won't work.
So I changed to this:
class commonStyle
{
private var insidevar:someclass
var outsidelet:someclass {return insidevar}
init(){
insidevar = someclass()
}
}
class iPhone6Style:commonStyle
{
override init() {
super.init()
insidevar = someclass("subclass value")
}
}Is there a better solution?
Thanks a lot.