How to change UITextField keyboard type to email in Swift

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

    Try it in Swift 3:

    let emailTextField: UITextField = {
        let text = UITextField()
        text.keyboardType = .emailAddress
    
        return text
    }()
    

提交回复
热议问题