ios - Objective-C : validating text field with number -
i'm new ios development. want know how can validate text field if contains number specific range, 10 contact number ? there predefined function available ?
thank you.
+ (bool) validatepassword:(nsstring *)password { nsstring *passwordregex = @"^[a-za-z0-9]{6,20}+$"; nspredicate *passwordpredicate = [nspredicate predicatewithformat:@"self matches %@",passwordregex]; return [passwordpredicate evaluatewithobject:password]; }
Comments
Post a Comment