Closed tester87 closed 6 years ago
Solved. Sample code as below:-
(BOOL)textField:(UITextField )textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString )string {
if (textField == txtEmail) { if (txtEmail.text.length >= 12 && range.length == 0) { return NO; } if(![txtEmail.text containsString:@"@"]) { txtEmail.errorMessage = @"Invalid Email"; } else { txtEmail.errorMessage = @""; } }
return YES; }
Hi all,
Is there any idea how to add in "invalid email" in objective C? Currently sample shown in swift version and I would like to apply this on Objective C. Please help.
Thank you.