Skip to content

nextforce/Formatter

 
 

Repository files navigation

Formatter

CardNumberFormatter
let formatter = CardNumberFormatter()
formatter.formatString("1234 5678 1234 5678") 
// => "1234 5678 1234 5678"
CardExpirationDateFormatter
let formatter = CardExpirationDateFormatter()
formatter.formatString("0119")
// => 01/19

Use reverse to return the formatted text to its original form.

let formatter = CardExpirationDateFormatter()
formatter.formatString("01/19", reverse:true)
// => 0119

Installation

Formatter is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Formatter'

License

Formatter is available under the MIT license. See the LICENSE file for more info.

Author

Elvis Nuñez, @3lvis

About

String Formatters

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 85.0%
  • Ruby 15.0%