How to change UITextField keyboard type to email in Swift

后端 未结 6 1088
伪装坚强ぢ
伪装坚强ぢ 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:50

    You should just set the type of entry to TextField you want to change. e.g.

    self.yourlTextField.keyboardType = .emailAddress //shows keyboard with e-mail characters
    
    self.yourTextField.keyboardType = .phonePad ////shows phone pad only..just numbers
    

提交回复
热议问题