title: Swift 1.2 optional external variable?
body: <p>Since Swift can't access compile variables, I created an objective c extern variable that points to the compile variable.</p>
  
  <p>CompileVaribleConvertor.h</p>
  
  <pre><code>extern NSString * const NetworkApiBasicAuthUsername;
  </code></pre>
  
  <p>CompileVaribleConvertor.m</p>
  
  <pre><code>// AUTH_USERNAME might not be defined depending on the environment we are pointing to
  #if defined(AUTH_USERNAME)
      NSString * const NetworkApiBasicAuthUsername = @AUTH_USERNAME;
  #else
      NSString * const NetworkApiBasicAuthUsername = nil;
  #endif
  </code></pre>
  
  <p>NetworkManager.swift</p>
  
  <pre><code>if CSNetworkApiAuthUsername != nil {
    // Basic auth is required set them
  }
  </code></pre>
  
  <p><strong>This code used to work on Swift 1.0</strong>, but Swift 1.2 gives compile error.
  Binary operator '!=' cannot be applied to operands of type 'String' and 'nil'</p>
  
  <p>How do I make the extern variable an optional, I tried defining the extern variable as <code>__nullable</code> with no luck</p>