I tried the code below, but only for entering numbers on the keyboard. My application requires the keyboard to use a period / full stop (for money transactions). The code I tried is:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSCharacterSet *nonNumberSet = [[NSCharacterSet decimalDigitCharacterSet] invertedSet]; if ([string rangeOfCharacterFromSet:nonNumberSet].location != NSNotFound) { return NO; } return YES; }
Thanks for any help.
ios numbers iphone-keypad
Devc
source share