set Textfield Length

-(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if(_userNameTextField.text.length >= 50 && range.length == 0) {
return NO;

}
if(_companyNameTextField.text.length >= 30 && range.length == 0) {
return NO;

}
if(_passwordTextField.text.length >= 30 && range.length == 0) {
return NO;

}
return YES;
}
Previous
Next Post »