/*********属性观察*******************/
class WangMumu {
var date: NSData {
willSet{
print("赋值前的值\(date)")
print("赋值后的值\(newValue)")
}
didSet{
print("赋值前的值\(oldValue)")
print("赋值后的值\(date)")
}
}
init(){
date = NSData()
}
}
/*!
* set get willSet didSet 重写
*/
class A {
var number : Int {
get {
return 1
}
set {
}
}
}
class B : A {
override var number: Int {
willSet{ }
didSet { }
}
}