10

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.

Community
  • 1
  • 1
Recycled Steel
  • 2,272
  • 3
  • 30
  • 35
  • 1
    I agree with the concept here, why would a keyboard identify as email input type, still support emoji? Kinda defeats the purpose of an email specific keyboard type imo. – Aaron Smentkowski Oct 25 '19 at 17:23

1 Answers1

5

User have to follow below steps if he wants to get rid of emoji button.

  • Settings---> General ---> keyboard-----> Keyboards---> You'll see ENGLISH and EMOJI.
  • On the top right corner is the word EDIT.
  • Press EDIT, and then swipe delete to remove the EMOJI keyboard.

This will remove the emoji button and user can also have easy access to @ and . signs.

Note:- For security reasons, iOS does not allow programmers to remove keyboard programatically.

pkc456
  • 8,350
  • 38
  • 53
  • 109