When setting the keyboard in IB or programatically as below for a UITextField.
[textFieldOutlet setKeyboardType:UIKeyboardTypeEmailAddress];
The keyboard has an Emoji icon which means you can type in Emoji's in an email address (which is a bit rubbish). Can this be disabled? I understand I can change the type to ASCIICapable but then I do not have the easy access to @ and . signs.
I have worked around it with this which just stops the Emoji being entered but the button is still there (Credit Here with MeganZhou answer).
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if ([textField isFirstResponder])
{
if ([[[textField textInputMode] primaryLanguage] isEqualToString:@"emoji"] || ![[textField textInputMode] primaryLanguage])
{
return NO;
}
}
return YES;
}
I have also noted that the icon is there when you are typing an email address in Mail too.
This is iOS8 but may also be in earlier version.