title: Swift property observer and nil
body: <p>I have a property observer code that must modify an iboutlet property:</p>
  
  <pre><code>@IBOutlet weak var canYouGuessLbl: UILabel!
  
  var isNewUser: Bool = false {
      didSet {
          if isNewUser {
              canYouGuessLbl!.layer.zPosition = 5
              canYouGuessLbl!.hidden = false
          } else {
              canYouGuessLbl!.hidden = true  // Error at this line
          }
  
      }
  }
  </code></pre>
  
  <p>This crashes at runtime because canYouGuessLbl! seems to be nil:</p>
  
  <pre><code>fatal error: unexpectedly found nil while unwrapping an Optional value
  </code></pre>
  
  <p>I'm not sure about the reason and how to resolve this.</p>