繁体   English   中英

如何在Swift项目中实现PayU Objective C库

[英]How to implement PayU Objective C library in Swift project

https://github.com/PayU/paytouch-ios我将SDK文件夹粘贴到我的项目中,并创建了Bridging-Header.h,在其中我导入了#import“ PUSDK.h”,并尝试在其中的viewController中进行初始化viewDidLoad 让paymentService = PUPaymentService()且应用程序崩溃而没有错误。

class ViewController: UIViewController, PUPaymentServiceDelegate{


func paymentServiceDidRequestPresenting(_ viewController: UIViewController) {
    self.navigationController?.present(viewController, animated: true, completion: {

    })
}


override func viewDidLoad() {
    super.viewDidLoad()
    let paymentService = PUPaymentService()
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()

}
extension ViewController: PUAuthorizationDataSource{
func refreshToken(completionHandler: @escaping (String?, Error?) -> Void) {
    completionHandler("", nil)
}

func applicationCallbackScheme() -> String {
    return ""
}

我已经找到解决方案。 我要做的就是取消选中“编辑方案”中的“调试可执行文件”。库中有一些错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM