TextFieldFormatter - Simple Text Formatter (Credit Card Number, Phone Number, Serial Number etc.)

Overview

TextFieldFormatter

Simple Text Formatter (Credit Card Number, Phone Number, Serial Number etc.) Can be used in all text inputs according to the format pattern. If desired, large minor character restrictions can be made in the format pattern.

Display Visual Example


Visual1

Installation

Manual

The easiest way to install this framework is to drag and drop the TextFieldFormatter/TextFieldFormatter/Classes folder into your project.

CocoaPods

Add the following to your Podfile:

use_frameworks!
pod 'TextFieldFormatter'

Interface Builder

The library is a simple drop-in, as soon as you set your subclass to one of the effects and your module to UITextField -> TextFieldFormatter you will be able to see all the IBDesignable settings in the storyboard.

Code

If you like to get your hands dirty, you can use them just like you would normally use any UITextField

Phone Number

let textField = TextFieldFormatter(frame: textFieldFrame)

textField.pattern = "(NNN) NNN NN NN"
textField.text = "9993334422" // showing text -> "(999) 333 44 22"

view.addSubView(textField)

Credit Card

let textField = TextFieldFormatter(frame: textFieldFrame)

textField.pattern = "NNNN NNNN NNNN NNNN"
textField.text = "9999333344442222" // showing text -> "9999 3333 4444 2222"

view.addSubView(textField)

Serial Number

let textField = TextFieldFormatter(frame: textFieldFrame)

textField.pattern = "CC NNNN"
textField.text = "cv9999" // showing text -> "CV 9999"

view.addSubView(textField)

How to use ?

If the text format is entered uppercase, the character input from the keyboard is displayed as a upper case character.

'x' or 'X' -> Any character

'c' or 'C' -> Alphabetic character

'n' or 'N' -> Numerical character

Author

Anil ORUC, [email protected]

License

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

Is that simple.

Build and run the project files. Enjoy more examples!

You might also like...
Accept credit cards and PayPal in your iOS app
Accept credit cards and PayPal in your iOS app

Important: PayPal Mobile SDKs are Deprecated. The APIs powering them will remain operational long enough for merchants to migrate, but the SDKs themse

A Payment Card UI & Validator for iOS
A Payment Card UI & Validator for iOS

Description Caishen provides an easy-to-use text field to ask users for payment card information and to validate the input. It serves a similar purpos

Bank Card Generator with Swift using SnapKit DSL 💳
Bank Card Generator with Swift using SnapKit DSL 💳

iCard BankCard & CreditCard generator with Swift 3 using SnapKit DSL iCard is a simple tool for generate Credit & Bank Card , it represent cards as UI

Welcome Busines Card Built With Swift
Welcome Busines Card Built With Swift

BusinessCard Welcome Busines Card Main screen Contacts screen More info screen

A card viewer demo for Idolmaster Millionlive Theater Days written in Swift UI
A card viewer demo for Idolmaster Millionlive Theater Days written in Swift UI

Misaki Gallery A Millionlive's cards gallery to demostrate Swift UI. All api and

A study card application built with SwiftUI and Combine
A study card application built with SwiftUI and Combine

StudyCards Description A study card application. I built this application to get

Code1System Card Moudle

Code1CardLib Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation Code1

SwiftUI BusinessCard - Created iOS Business card app to practice SwiftUI
SwiftUI BusinessCard - Created iOS Business card app to practice SwiftUI

SwiftUI_BusinessCard Created iOS Business card app to practice SwiftUI

Wizards-pal - Life counter for card games,built with swift
Wizards-pal - Life counter for card games,built with swift

Life counter for card games Made this app in the weekend to help ma boys with ht

Releases(0.1.0)
Owner
Anıl ORUÇ
Anıl ORUÇ
Card Decks is a small utility application for your iPhone, iPod touch and iPad which brings you simple, configurable, colored, multi-line text cards that are grouped into card decks

Card Decks is a small utility application for your iPhone, iPod touch and iPad which brings you simple, configurable, colored, multi-line text cards that are grouped into card decks.

Arne Harren 40 Nov 24, 2022
Easy to use iOS library with components for input of Credit Card data.

AnimatedCardInput This library allows you to drop into your project two easily customisable, animated components that will make input of Credit Card i

Netguru 39 Oct 16, 2022
Easily integrate Credit Card payments module in iOS App. Swift 4.0

MFCard Buy me a coffee MFCard is an awesome looking Credit Card input & validation control. Written in Swift 3. YOoo, Now MFCard is on Swift 5. Swift

MobileFirst 362 Nov 29, 2022
A credit card reader and parser for iOS Using Native Vision/VisionKit

card-reader-ios A credit card reader and parser for iOS Using Native Vision/VisionKit May-14-2021.00-43-17.mp4 Instructions Hold camera up to a card a

Khalid Asad 104 Dec 15, 2022
Debit/Credit card validation port of the Luhn Algorithm in Swift

SwiftLuhn Warning! This repository is no longer maintained. This is a port of the Luhn Algorithm, generally used for validating debit/credit card deta

Max Kramer 135 Sep 9, 2022
Luhn Credit Card Validation Algorithm

Luhn Algorithm This is a port of the Luhn Algorithm, generally used for validating Credit Card details, to Objective-C (iOS). Swift port can be found

Max Kramer 127 Nov 27, 2022
CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card.

CreditCardForm CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card. Fixed typo use CreditCa

Orazz 1.4k Dec 15, 2022
A credit card scanner for iOS written in Swift

DGCardScanner A credit card scanner Requirements iOS 13.0+ Swift 5.5+ Xcode 10.0+ Installation SPM File > Add Packages > https://github.com/donggyushi

donggyu 9 Jun 24, 2022
Luhn Credit Card Validation Algorithm

Luhn Algorithm This is a port of the Luhn Algorithm, generally used for validating Credit Card details, to Objective-C (iOS). Swift port can be found

Max Kramer 127 Nov 27, 2022
Ios-card-transition - iOS CocoaPod to create beautiful card transitions

CSCardTransition CSCardTransition is a small library allowing you to create wond

Creastel 12 Oct 31, 2022