title: Why doesn't this optional binding work as expected?
body: <p>I'm in the process of introducing Swift to an Objective-C app.</p>
  
  <p>I have a UIViewController subclass where I want to hide a button if a certain property is nil. My Swift code looks like this, using optional binding:</p>
  
  <pre><code>if let optionalVar = modelObject.propertyThatCouldBeNil {
     button.setTitle(...)
  } else {
     button.hidden = true
  }
  </code></pre>
  
  <p>My hope was that when propertyThatCouldBeNil was nil, the if wasn't satisfied and control would continue to the else. But that's not what's happening. In fact if I set a breakpoint, what I see is...</p>
  
  <pre><code>(lldb) po optionalVar
  nil
  (lldb) po modelObject.propertyThatCouldBeNil
  ▿ Optional&lt;Optional&lt;String&gt;&gt;
    - some : nil
  </code></pre>
  
  <p>That latter one is what's tripping me up a bit. I think it should be Optional, not nested, correct?</p>
  
  <p>Some more info...</p>
  
  <p>Since I'm using modelObject throughout this class, for convenience it's defined as an implicitly unwrapped optional...</p>
  
  <pre><code>var modelObject : ModelObjectClass!
  </code></pre>
  
  <p>ModelObjectClass is actually an Objective-C class, and the property is read only and declared as such...</p>
  
  <pre><code>@property (readonly, nullable) NSString *propertyThatCouldBeNil;
  </code></pre>
  
  <p>In it's implementation, it actually acts as a sort of proxy for another ready only property...</p>
  
  <pre><code>- (NSString*) propertyThatCouldBeNil {
     return self.someOtherProperty;
  }
  </code></pre>
  
  <p>And the someOtherProperty is nullable as well...</p>
  
  <pre><code>@property (nullable, nonatomic, retain) NSString *someOtherProperty;
  </code></pre>
  
  <p>Any insight as to why the optional binding isn't working as I expect?</p>