title: How to check for API availability in Xcode 9
body: <p>I'm using he <code>UserNotification</code> framework that is available only in iOS 10. I am declaring a method that uses this framework and so far, I have been doing the check for the availability as follows:</p>
  
  <pre><code>@interface MyService : NSObject
   #if __IPHONE_OS_VERSION_MAX_ALLOWED &gt;= 100000
      -(BOOL)handleWillPresentNotification:(UNNotificationContent *)notificationContent;
  #endif
  @end
  </code></pre>
  
  <p>XCode 9 beta was just release and with this code I get a warning</p>
  
  <blockquote>
    <p>'UNNotificationContent' is partial: introduced in iOS 10.0
    Annotate 'handleWillPresentNotification:withCompletionHandler:' with an availability attribute to silence</p>
  </blockquote>
  
  <p>The question is how do I annotate this in Objective C code the entire method? I know that Xcode 9 introduced the </p>
  
  <pre><code>if (@available(iOS 10, *)) {
      // iOS 10 ObjC code
  }
  </code></pre>
  
  <p>but how do I wrap the entire method (including its signature) in it?</p>
  
  <p>cheers</p>