Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

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

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages