When/How - Outlet -> didSet
问题 I'm wondering, when/how does the didSet on an outlet actually trigger? For example : @IBOutlet weak var modifyButton: UIButton! { didSet { modifyButton.layer.cornerRadius = 9 } } 回答1: Outlet properties initialized as nil when class just initialized. They will have values later, when objects will be initialized from nib. First step, when you can be sure that all properly configured outlet properties have nonnil values is viewDidLoad . So, didSet observer on this properties will be called just