https://github.com/MobileFirstInc/MFCard
  
  
    Easily integrate Credit Card payments module in iOS App. Swift 4.0  
    https://github.com/MobileFirstInc/MFCard
  
animation card cocoapods credit-card ios mobilefirst payment swift validation
        Last synced: 3 months ago 
        JSON representation
    
Easily integrate Credit Card payments module in iOS App. Swift 4.0
- Host: GitHub
 - URL: https://github.com/MobileFirstInc/MFCard
 - Owner: MobileFirstInc
 - License: mit
 - Created: 2016-11-07T10:29:51.000Z (almost 9 years ago)
 - Default Branch: master
 - Last Pushed: 2020-07-29T06:15:25.000Z (over 5 years ago)
 - Last Synced: 2024-12-07T05:10:39.401Z (11 months ago)
 - Topics: animation, card, cocoapods, credit-card, ios, mobilefirst, payment, swift, validation
 - Language: Swift
 - Homepage:
 - Size: 23.9 MB
 - Stars: 365
 - Watchers: 19
 - Forks: 48
 - Open Issues: 12
 - 
            Metadata Files:
            
- Readme: README.md
 - License: LICENSE
 
 
Awesome Lists containing this project
- awesome-ios - MFCard - Easily integrate Credit Card payments in iOS App / Customisable Card UI. (Payments / Other Parsing)
 - awesome-swift - MFCard - Easily integrate Credit Card payments in iOS App. (Libs / UI)
 - awesome-swift - MFCard - Easily integrate Credit Card payments in iOS App. (Libs / UI)
 - awesome-ios-star - MFCard - Easily integrate Credit Card payments in iOS App / Customisable Card UI. (Payments / Other Parsing)
 - fucking-awesome-swift - MFCard - Easily integrate Credit Card payments in iOS App. (Libs / UI)
 - awesome-swift - MFCard - Easily integrate Credit Card payments module in iOS App. Swift 4.0 ` 📝 a year ago` (UI [🔝](#readme))
 
README
          
# MFCard
MFCard is an awesome looking Credit Card input & validation control. Written in Swift 3.
YOoo, Now MFCard is on Swift 5.
* Swift 5.0 (Xcode 11.0)*
```ruby
pod 'MFCard'
```
*Or you can choose version for Swift 4*
```ruby
pod 'MFCard', '1.2.6'
```

## MobileFirst Applications
We are a mobile development agency working on Swift for iOS, Java for Android. We are available for new projects. 
## Demo

## Usage
First Step  - `@import MFCard` to your project
Second Step - Add a delegate `MFCardDelegate` to your class & add two delegate methods
Third Step - Present a Card
```
var myCard : MFCardView
myCard  = MFCardView(withViewController: self)
myCard.delegate = self
myCard.autoDismiss = true
myCard.toast = true
myCard.showCard()
```
## Handle Done button(delegate method) clicked
```
func cardDoneButtonClicked(_ card: Card?, error: String?) {
if error == nil{
print(card!)
}else{
print(error!)
}
}
```
## Show Card with Details
```
var myCard : MFCardView
myCard  = MFCardView(withViewController: self)
myCard.delegate = self
myCard.autoDismiss = true
myCard.toast = true
let demoCard :Card? = Card(holderName: "Rahul Chandnani", number: "6552552665526625", month: Month.Dec, year: "2019", cvc: "234", paymentType: Card.PaymentType.bank, cardType: CardType.Discover, userId: 0)
myCard.showCardWithCardDetails(card: demoCard!)
```
## CocoaPods Install
Add this to your Podfile.
```
pod 'MFCard'
```
## Supported Cards
* MasterCard
* Visa
* JCB
* Diners
* Discover
* Amex
* Maestro
* UnionPay
* Electron
* Dankort
* RuPay
## Customisation Options
- Card Image
- Background colour
- Front Chrome colour (Front Card colour)
- Back Chrome colour (Back Card colour)
- Front Chrome Alpha
- Back Chrome Alpha
- Back Card Magnetic Tap colour
- All Label colour
- TextField Customisation
- Control Buttons
- Corner Radius
- Placeholders
- Auto Dismiss
- Flip on Done
- Animation on CardType Change
- MFCard show - BlurStyle
## Screenshots



## Features
- Card Validation Support
- Present Card like alert
- Swipe Gesture To Swipe Card front & back
- Error Handing
- Toast Messages for error handling
- All Properties editable using IBDesignable
- Animations
- Easy to use
## Collaboration
Feel free to collaborate with ideas, issues and/or pull requests.
## Further Plans
- Provide More Classic card views
- Mutiple Card Collection Viewer
- Stripe Integration
- Language Support (French, Spanish)
- More Animations :-P
## Thanks
- https://github.com/RC7770/CreditCardValidator
- https://github.com/scalessec/Toast-Swift
- Icon Credit : https://thenounproject.com/term/credit-card/490264/
## Contact
* Arpan & Rahul (http://mobilefirst.in)
* Twitter: [@mobilefirstinc](http://twitter.com/mobilefirstinc)
* Email : [arpan at mobilefirst.in](mailto:arpan@mobilefirst.in)
## License
MFCard is released under the [MIT License](http://www.opensource.org/licenses/MIT).