当我尝试使用Card.IO扫描卡时。它不会带来相机,更不用说它周围的绿线了。当我运行此代码并按下按钮时,它不会在视图控制器中显示相机。有任何想法吗 ?该示例在obj-C中的io8中工作正常。
@IBAction func PressScan(sender: AnyObject) {
var CardScanner : CardIOPaymentViewController = CardIOPaymentViewController()
CardScanner.modalPresentationStyle = UIModalPresentationStyle.FullScreen
self.presentViewController(CardScanner, animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
CardIOPaymentViewController.preload()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func userDidProvideCreditCardInfo(cardInfo: CardIOCreditCardInfo!, inPaymentViewController paymentViewController: CardIOPaymentViewController!) {
}
func userDidCancelPaymentViewController(paymentViewController: CardIOPaymentViewController!) {
}
我需要修改plist文件中的某些内容以允许iOS8的摄像头访问吗?
答案 0 :(得分:0)
解决方案在这里:https://github.com/card-io/card.io-iOS-SDK/issues/76#issuecomment-65856792
即:
您没有正确初始化CardIOPaymentViewController。它应该是
var CardScanner:CardIOPaymentViewController = CardIOPaymentViewController(paymentDelegate:self)