title: How to use a Objective-C #define from Swift
body: <p>I am migrating a <code>UIViewController</code> class to train a bit with Swift. I am successfully using Objective-C code via the bridging header but I have the need of importing a constants file that contains <code>#define</code> directives.</p>
  
  <p>I have seen in <a href="https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/buildingcocoaapps/BuildingCocoaApps.pdf" rel="noreferrer">Using Swift with Cocoa and Objective-C</a> (Simple macros) the following:</p>
  
  <blockquote>
    <p><strong>Simple Macros</strong></p>
    
    <p>Where you typically used the <code>#define</code> directive to define a primitive constant in C and Objective-C, in Swift you use a global constant instead. For example, the constant definition <code>#define FADE_ANIMATION_DURATION 0.35</code> can be better expressed in Swift with <code>let FADE_ANIMATION_DURATION = 0.35</code>. Because simple constant-like macros map directly to Swift global variables, the compiler automatically imports simple macros defined in C and Objective-C source files.</p>
  </blockquote>
  
  <p>So, it seems it's possible. I have imported the file containing my constants into the bridging header, but I have no visibility from my <code>.swift</code> file, cannot be resolved.</p>
  
  <p>What should I do to make my constants visible to Swift?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>It seems working with <code>NSString</code> constants, but not with booleans:</p>
  
  <pre><code>#define kSTRING_CONSTANT @"a_string_constant" // resolved from swift
  #define kBOOL_CONSTANT YES // unresolved from swift
  </code></pre>