title: Lazy Var vs Let
body: <p>I want to use Lazy initialization for some of my properties in Swift.
  My current code looks like this:</p>
  
  <pre><code>lazy var fontSize : CGFloat = {
    if (someCase) {
      return CGFloat(30)
    } else {
      return CGFloat(17)
    }
  }()
  </code></pre>
  
  <p>The thing is that once the fontSize is set it will NEVER change.
  So I wanted to do something like this:</p>
  
  <pre><code>lazy let fontSize : CGFloat = {
    if (someCase) {
      return CGFloat(30)
    } else {
      return CGFloat(17)
    }
  }()
  </code></pre>
  
  <p>Which is impossible.</p>
  
  <p>Only this works:</p>
  
  <pre><code>let fontSize : CGFloat = {
    if (someCase) {
      return CGFloat(30)
    } else {
      return CGFloat(17)
    }
  }()
  </code></pre>
  
  <p>So - I want a property that will be lazy loaded but will never change.
  What is the correct way to do that? using <code>let</code> and forget about the lazy init? Or should I use <code>lazy var</code> and forget about the constant nature of the property?</p>