【发布时间】:2019-06-07 03:31:04
【问题描述】:
当我尝试在 ApplePay 的代码块下方为 iOS 编译 react-native 应用程序时
let applePayController = PKPaymentAuthorizationViewController(paymentRequest: request)
applePayController.delegate = self
let rootViewController:UIViewController? = UIApplication.shared.delegate?.window??.rootViewController!
rootViewController!.present(applePayController, animated: true, completion: nil)
抛出运行时错误。
Value of optional type 'PKPaymentAuthorizationViewController?' must be unwrapped to refer to member 'delegate' of wrapped base type 'PKPaymentAuthorizationViewController'
我该如何解决这个问题?
【问题讨论】:
标签: ios swift react-native applepay xcode10.2