Swift: how to use PREPROCESSOR Flags (like `#if DEBUG`) to implement API keys?
<p>In <code>Objective-C</code> it was sometimes useful to use static string constants to define alternate API keys (for example to differentiate between RELEASE and DEBUG keys for analytics packages, like MixPanel, Flurry or Crashlytics):</p>

<pre><code>#if DEBUG
static NSString *const API_KEY = @"KEY_A";
#else
static NSString *const API_KEY = @"KEY_B";
#endif
</code></pre>

<p>and then...</p>

<pre><code>[Analytics startSession:API_KEY];
</code></pre>

<p>How does this translate to Swift, since the Swift compiler no longer uses a preprocessor?</p>