title: Import module only if iOS 11 is available
body: <p>I want to import a module from CocoaPods in my project which has the minimum deployment target set to iOS 9.0.</p>
  
  <p>In my Podfile, I set the minimum deployment target for that specific framework to iOS 11 like this:</p>
  
  <pre><code>  #CoreML
    platform :ios, '11.0'
    pod 'xxx', '1.0.0'
  </code></pre>
  
  <p>so that it would allow me to <code>pod install</code>.</p>
  
  <p>The problem is when I import it in my file, I receive the following error: </p>
  
  <blockquote>
    <p>Module file's minimum deployment target is ios11.0 v11.0.</p>
  </blockquote>
  
  <p>How should I import it only if iOS 11 is available? I tried using </p>
  
  <pre><code>if #available(iOS 11, *) { ... } 
  </code></pre>
  
  <p>and <code>@available(iOS 11)</code>, but with no luck.</p>