title: How to correctly use #ifdef DEBUG / RELEASE values in Swift Code?
body: <p>This question is <strong>NOT</strong> about how to create/use Objective-C like <code>#ifdef</code> statements in Swift, which has been discussed in other questions.</p>
  
  <p>This question is about how to use existing Objective-C code from existing <code>#ifdef</code> statements in Swift:</p>
  
  <p>I am working on migrating my existing iOS 9+ app from <code>Objective-C</code> to <code>Swift</code>. While large parts of the app still use <code>Objective-C</code> new View Controllers, Classe, etc. are added using Swift.</p>
  
  <p>The <code>Objective-C</code> code uses <code>#ifdef</code> statements to create different code for debugging and release and for different app targets like a Freemium and a Pro version:</p>
  
  <pre><code>#ifdef PRO_VER
      #define APP_NAME @"My App Pro"
  #else
      #define APP_NAME @"My App"
  #endif 
  </code></pre>
  
  <h1>The Problem</h1>
  
  <p>When using these constants in <code>Objective-C</code> everything is fine. When using the same constants within the same target in Swift, they always have the non-pro value:</p>
  
  <pre><code>// Using in Objective-C within the Pro Target
  NSLog(@"The objc app name is: %@", APP_NAME);
  
  // Using in Swift within the Pro Target
  print("The Swift app name is: \(APP_NAME)")
  
  
  Output:
      The objc app name is: My App Pro
      The Swift app name is: My App
  </code></pre>
  
  <p>So, the same constant has different values when being used in Swift or Objective-C.</p>
  
  <p>Of course, this could be solved by creating a static Objective-C method/property which returns the correct value which is then be used by the Swift code. However, this would be quite hacky and cumbersome.</p>
  
  <p><strong>Is there a better solution to get the correct values from within Swift code?</strong></p>