Search code examples
iosswiftkeyboard

How to set keyboard layout such that it is easy to input email?


How can I make it so that the user's keyboard is suited to inputting email info? I have found nothing on this online.

I should note that I want to do this programaticaly


Solution

  • In code you can do it with:

    someTextField.keyboardType = .emailAddress
    

    The best way would be to configure text field to expect email content: In XCode interface builder, in Attributes inspector for Text input traits: Content type set value Email Address

    enter image description here