title: What is the best way to in Swift to test if running under OS X or iOS?
body: <p>I'm writing a framework in Swift that is used in OS X and iOS programs. What is the best way <strong>at runtime</strong> to find out if a method is running under OS X or iOS?</p>
  
  <p>At <strong>compile time</strong> it is easy:</p>
  
  <pre><code>#if os(iOS)
      println("iOS")
      #else
      println("OS X")
  #endif
  </code></pre>
  
  <p>At <strong>runtime</strong> there is <code>NSProcessInfo()</code> and it's methods to gather information like <code>operatingSystemVersion</code> and <code>isOperatingSystemAtLeastVersion:</code>, but they don't distinguish between the operating system type itself.</p>
  
  <p><code>operatingSystem</code> and <code>operatingSystemName</code> would be great, but they marked deprecated and are not available in Swift.</p>