21
20

More than 5 years have passed since last update.

IBOutletでdidSetを使って、プロパティの初期値を設定する

Posted at
@IBOutlet weak var myView: UIView! {
    didSet {
        myView.backgroundColor = UIColor.blackColor()
    }
}

didSetを使えば、プロパティの初期値を簡単に設定することができます。

21
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
20