Skip to content

Automatically format the number typed in an UITextField to CPF (Brazilian individual taxpayer registration).

License

Notifications You must be signed in to change notification settings

cairano/CIFormatCPFNumber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIFormatCPFNumber

Automatically format the number typed in an UITextField to CPF (Brazilian individual taxpayer registration).

Usage

Import CIFormatCPFNumber folder files to your project and include the h file in view controller.

#import "CIFormatCPFNumber.h"

In your view controller, set UITextFieldDelegate in h file.

@interface ViewController : UIViewController <UITextFieldDelegate>

And set the delegate of the UITextField in m file.

self.fieldCPF.delegate = self;

Create the shouldChangeCharactersInRange delegate and call the formatter within the code.

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {

[CIFormatCPFNumber inTextField:textField usingRange:range withString:string];

return YES;
}

It's all!

About

Automatically format the number typed in an UITextField to CPF (Brazilian individual taxpayer registration).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published