title: How to implement PKPaymentAuthorizationViewControllerDelegate in Xcode 9 for iOS 8 backwards compatibility?
body: <p>I'm trying to build an app that uses Apple Pay on Xcode 9. The deployment target is iOS 8. </p>
  
  <p>Up until Xcode 8.3.3 (and the iOS 10 SDK) this worked perfectly:</p>
  
  <pre><code>extension MyViewController: PKPaymentAuthorizationViewControllerDelegate {
  
  func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingAddress address: ABRecord, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -&gt; Void) {
      // handle the ABRecord for iOS 8
  }
  
  @available(iOS 9.0, *)
  func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -&gt; Void) {
      // handle the PKContact on iOS 9 and later
  }
  </code></pre>
  
  <p>Now, with Xcode 9 I get the following build error:</p>
  
  <blockquote>
    <p>Protocol 'PKPaymentAuthorizationViewControllerDelegate' requires 'paymentAuthorizationViewController(_:didSelectShippingContact:completion:)' to be available on iOS 8.0 and newer</p>
  </blockquote>
  
  <p>Which means, that I am supposed to change the <code>@available(iOS 9, *)</code> to <code>@available(iOS 8, *)</code>.</p>
  
  <p>Looking into the definition of <code>PKPaymentAuthorizationViewControllerDelegate</code> I see the following:</p>
  
  <pre><code>@available(iOS, introduced: 8.0, deprecated: 11.0, message: "Use paymentAuthorizationViewController:didSelectShippingContact:handler: instead to provide more granular errors")
  optional public func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -&gt; Swift.Void)
  </code></pre>
  
  <p>So the method is defined as being available from iOS 8 on.</p>
  
  <p>Here comes the catch: Looking into the definition of <code>PKContact</code> (which is part of the method signature of the above method) you can see the following:</p>
  
  <pre><code>@available(iOS 9.0, *)
  open class PKContact : NSObject {
      ...
  }
  </code></pre>
  
  <p>So, according to the current SDK, the method is available on iOS 8 (which leads to the build error) but one of its parameter types is only available on iOS 9. This seems to be mutual exclusive.</p>
  
  <p>I know that the method I'm trying to implement is deprecated but the replacement is only available on iOS 11 so for now it seems that I need to implement the deprecated methods anyways (or am I mistaken here?).</p>
  
  <p>Does anybody have the same issue? Any thoughts on this? I appreciate every thought :)</p>
  
  <p>Thank you!</p>