How to do proper Lazy Loading in Swift
Mikael Konradsson
2205

> You must use lazy to prevent the closure for being created more than once.

This is incorrect.

  1. You probably meant “the closure for being called”.
  2. You use `lazy` to avoid initializing of the variable at the time your object is created. With `lazy` the closure will be called at the first time you access the variable. If you don’t specify `lazy` — the closure will be called at the time you create your object, but it will be also called just once.

https://gist.github.com/yas375/b0faae5c6200a7a9d402

Like what you read? Give Victor Ilyukevich a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.