class Person {
var name: String
init(name: String) {
self.name = name
}
}
class Boy: Person {
var gf: String! {
didSet {
print("have a girlfriend: \(gf)")
}
}
override init(name: String) {
super.init(name: name)
gf = "Lilian"
}
}
I think the property "gf" has been initialized before calling "super.init", and the value is nil. So below "super.init", resetting the "gf" should call its "didSet". But it didn't. I wanna know the reason.