This is a fully functional Card View that provides validated card data which is ready to use. Supports Credit, Debit, Master Card Etc.
- Name Validation
- Credit/Debit/Master card validation through luhn algorithm
- Card Expiry Validation
- Properly formatted UI
- Very easy integration through storyboards or programmatically.
You want to add pod 'CreditCardViewSwift', '~> 1.0' to your Podfile. It should look something similar to this.
target 'MyApp' do
pod 'CreditCardViewSwift', '~> 1.0'
end
Then run a pod install inside your terminal
import UIKit
import CreditCardViewSwift
class ViewController: UIViewController {
@IBOutlet weak var creditCardView: CreditCardViewSwift!
override func viewDidLoad() {
super.viewDidLoad()
creditCardView.delegate = self
}
}
extension ViewController: CreditCardViewSwiftDelegate {
func cardDataValidated(name: String, cardNumber: String, cardExpiry: String, cvvNumber: String) {
//Once Validated, this delegate method will return all the validated data
}
}