Quantcast
Viewing all articles
Browse latest Browse all 12

Answer by orkoden for What is the purpose of willSet and didSet in Swift?

One thing where didSet is really handy is when you use outlets to add additional configuration.

@IBOutlet weak var loginOrSignupButton: UIButton! {  didSet {        let title = NSLocalizedString("signup_required_button")        loginOrSignupButton.setTitle(title, for: .normal)        loginOrSignupButton.setTitle(title, for: .highlighted)  }

Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>