willset和didset

Swift语言中willSet和didSet的用法,监控属性变化

看看下面的代码你就能很快明白的


import Foundation


class People : NSObject
{
    //普通属性
    var firstName:String = ""
    var lastName:String  = ""
    var nickName:String  = ""
    

» 阅读全文

关键词: willset和didset , swift