I am doing a customized keyboard, but I want to use some default key such as space and delete key. This is the code that I use to disable key a-z.
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSMutableString * character;
NSCharacterSet *disableLetters = [[NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyz"] invertedSet];
NSRange location = [character rangeOfCharacterFromSet:disableLetters];
return (location.location == NSNotFound);}
This is the Screen Shot :(I cannot delete ក after disable other keys)

There were a couple of problems with your code that I’ve fixed so this will now work:
This code has now been updated to only allow space, enter and delete to be used.