From 17330c161ddd3c8eddf64545bc48f97bcf54e20e Mon Sep 17 00:00:00 2001 From: "Carlos A. King" Date: Wed, 11 Apr 2018 21:29:05 -0400 Subject: [PATCH] Minor update in the CardIO Section Update some Swift code to the current version --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index abea756..d47b9b1 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ class ViewController: UIViewController, CardTextFieldDelegate, CardIOPaymentView func cardTextFieldShouldProvideAccessoryAction(_ cardTextField: CardTextField) -> (() -> ())? { return { [weak self] _ in let cardIOViewController = CardIOPaymentViewController(paymentDelegate: self) - self?.presentViewController(cardIOViewController, animated: true, completion: nil) + self?.present(cardIOViewController, animated: true, completion: nil) } } @@ -145,17 +145,17 @@ class ViewController: UIViewController, CardTextFieldDelegate, CardIOPaymentView // 4. When receiving payment card information from CardIO, prefill the text field with that information: func userDidProvideCreditCardInfo(cardInfo: CardIOCreditCardInfo!, inPaymentViewController paymentViewController: CardIOPaymentViewController!) { - cardTextField.prefillCardInformation( + cardTextField.prefill( cardInfo.cardNumber, month: Int(cardInfo.expiryMonth), year: Int(cardInfo.expiryYear), cvc: cardInfo.cvv) - paymentViewController.dismissViewControllerAnimated(true, completion: nil) + paymentViewController?.dismiss(animated: true, completion: nil) } func userDidCancelPaymentViewController(paymentViewController: CardIOPaymentViewController!) { - paymentViewController.dismissViewControllerAnimated(true, completion: nil) + paymentViewController?.dismiss(animated: true, completion: nil) } } ```