【发布时间】:2019-01-02 00:41:24
【问题描述】:
let paymentContext: STPPaymentContext
init(product: String, price: Int, settings: Settings) {
//some other code
super.init(nibName: nil, bundle: nil)
self.paymentContext.delegate = self
paymentContext.hostViewController = self
}
// required init?(coder aDecoder: NSCoder) {
// fatalError("init(coder:) has not been implemented")
// }
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
我正在尝试遵循 Stripe 的 iOS 标准集成,我正在使用来自 https://github.com/stripe/stripe-ios/tree/master/Example/Standard%20Integration%20(Swift) 的代码,特别是 CheckoutViewController.swift 文件,但我最初收到关于致命错误的注释代码错误,因此我替换为代码就在上面,现在我得到一个编译错误,上面写着“属性'self.paymentContext'未在 super.init 调用时初始化”如果任何 swift 或 stripe 专家可以提供帮助,那就太好了!
【问题讨论】:
标签: ios swift stripe-payments