1. UITextField 点击空白地方取消键盘
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
textField.resignFirstResponder()
}
2. 密码模式
textField.isSecureTextEntry = true
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
textField.resignFirstResponder()
}
textField.isSecureTextEntry = true