How to change UITextField keyboard type to email in Swift

后端 未结 6 1087
伪装坚强ぢ
伪装坚强ぢ 2021-01-30 20:36

In objective-c I can just say the following.

[self.promoTextField setKeyboardType:UIKeyboardTypeEmailAddress];

I tried googling it but just ge

6条回答
  •  失恋的感觉
    2021-01-30 20:57

    In Swift 3 you might use:

    youremailfieldname.keyboardType = UIKeyboardType.emailAddress

    Note the lowercase in emailAddress

    Note: also that you can assign the keyboard type in the TextField definition in the storyboard.

提交回复
热议问题