title: Swift - Lazy Var vs. Let when creating views programmatically (saving memory)
body: <p>I'm a beginner and I sort of understand Lazy Var vs. Let. I've noticed that it saves a ton of memory usage when using Lazy Var especially with ImageViews. But the tutorials and guides I've seen so far don't use Lazy Var very often, so I'm feeling suspicious that it is bad practice and that I'm overlooking something.</p>
  
  <p>I did a little research and learned that Lazy isn't "thread safe," but I don't understand what this means. I've seen a lot of pros and cons, but I can't draw any conclusions especially because I have very limited knowledge.</p>
  
  <p>When is it ok (or better) to use Lazy Var vs. Let when creating a UIView?  </p>
  
  <pre><code>lazy var profileImageView: UIImageView = {
  
      let imageView = UIImageView(image: #imageLiteral(resourceName: "page1"))
      imageView.translatesAutoresizingMaskIntoConstraints = false
      imageView.contentMode = .scaleAspectFit
      return imageView
  
  }()
  </code></pre>