What is the advantage of a lazy var in Swift

Let’s do it practically. See the screenshot

enter image description here

I just stopped the debugger in viewDidLoad. You can see that secondHintView has a memory as it was not lazy for the storage but hintView is still nil as it is a lazy one. The memory gets allocated once you use/access the lazy variables.

Also lazy should be var always.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)