title: What's the Swift equivalent of Objective-C's "#ifdef __IPHONE_11_0"?
body: <p>I want to use Xcode 9 to add iOS 11 code to my project while keeping the option to compile the project with Xcode 8 which only supports iOS 10.</p>
  
  <p>In Objective-C I can do this by using a preprocessor directive to check if <code>__IPHONE_11_0</code> is defined. Which will hide the code if I'm compiling with a Base SDK earlier than iOS 11. Like this:</p>
  
  <pre><code>#ifdef __IPHONE_11_0
      if (@available(iOS 11.0, *)) {
          self.navigationController.navigationBar.prefersLargeTitles = YES;
      }
  #endif
  </code></pre>
  
  <p>Is there a way to do that in Swift? </p>
  
  <p><code>if #available(iOS 11.0, *)</code> doesn't work because that's a runtime check.</p>