title: Include an extension for a class only if iOS11 is available
body: <p>I am trying to extend a class written in Obj-C and include an extension written in Swift that makes it conform to the <code>UIDropInteractionDelegate</code>, like so:</p>
  
  <pre><code>@available(iOS 11.0, *)
  extension NoteEditViewController: UIDropInteractionDelegate {
      @available(iOS 11.0, *)
      public func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -&gt; UIDropProposal {
          let operation: UIDropOperation
          if session.localDragSession == nil {
              operation = .forbidden
          } else {
              // If a local drag session exists, we only want to move an
              // existing item in the pin board to a different location.
              operation = .forbidden
          }
          return UIDropProposal(operation: operation)
      }
  
      @objc(setupDropInteractions)
      @available(iOS 11.0, *)
      func setupDropInteractions() {
          // Add drop interaction
          self.view.addInteraction(UIDropInteraction(delegate: self))
      }
  }
  </code></pre>
  
  <p>My problem is that <code>Project_Name-Swift.h</code> file contains the following code that will not compile:</p>
  
  <pre><code>@class UIDropInteraction;
  @protocol UIDropSession;
  @class UIDropProposal;
  
  // This line is causing the issue saying "'UIDropInteractionDelegate' is partial: introduced in iOS 11.0"
  @interface NoteEditViewController (SWIFT_EXTENSION(Bloomberg_Professional)) &lt;UIDropInteractionDelegate&gt;
  - (UIDropProposal * _Nonnull)dropInteraction:(UIDropInteraction * _Nonnull)interaction sessionDidUpdate:(id &lt;UIDropSession&gt; _Nonnull)session SWIFT_WARN_UNUSED_RESULT SWIFT_AVAILABILITY(ios,introduced=11.0);
  - (void)setupDropInteractions SWIFT_AVAILABILITY(ios,introduced=11.0);
  @end
  </code></pre>
  
  <p>The compiler is complaining that the interface in that file is partial. </p>
  
  <blockquote>
    <p>'UIDropInteractionDelegate' is partial: introduced in iOS 11.0</p>
  </blockquote>
  
  <p>I assumed that including the <code>@available(iOS 11.0, *)</code> would generate a <code>SWIFT_AVAILABILITY(ios,introduced=11.0)</code> that would encapsulate the entire interface but I was wrong.</p>
  
  <p>Is there a way to fix this?</p>
  
  <p><strong>UPDATE</strong> </p>
  
  <hr>
  
  <p>I implemented a toy example.</p>
  
  <p>Here is the toy ViewController: </p>
  
  <p><a href="https://i.stack.imgur.com/KEz0d.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KEz0d.png" alt="enter image description here"></a> </p>
  
  <p>Here is the swift extension:</p>
  
  <p><a href="https://i.stack.imgur.com/BDiL7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BDiL7.png" alt="enter image description here"></a></p>
  
  <p>And here is the generated dnd_toy-Swift.h file.</p>
  
  <p><a href="https://i.stack.imgur.com/H402s.png" rel="noreferrer"><img src="https://i.stack.imgur.com/H402s.png" alt="enter image description here"></a></p>
  
  <p>You were right that it is simply a warning but my problem is that we must treat all warnings as errors in our project.</p>
  
  <p>Any ideas on how to get rid of this warning from here?</p>