Le 23 déc. 2015 à 11:07, Félix Cloutier via swift-evolution
<[email protected]> a écrit :
> willSet and didSet are currently not even called from the init method.
And they can't, because in those two blocks you have access to the old value as
well as the new value. How would that work when you're setting the initial
value?
var value: Int {
willSet { print("willSet \(value) -> \(newValue)") }
didSet { print("didSet \(oldValue) -> \(value)") }
}
--
Michel Fortin
https://michelf.ca
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution