Swift : Difference in '!' and '?' in swift

后端 未结 3 454
情书的邮戳
情书的邮戳 2021-01-07 13:48

I declared below:

@IBOutlet var hw_label : UILabel!

If I write as above than it\'s running successfully,

But when i declare as belo

3条回答
  •  花落未央
    2021-01-07 14:31

    One more thing:

    If you declare a ! mark variable in a class, you have to initialize the values for this variable in the init() method of this class.

提交回复
热议问题