class ViewController: UIViewController,UITextFieldDelegate{
@IBOutlet weak var chatting_Textfield: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
{
self.chatting_Textfield.delegate = self
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
self.view.endEditing(true)
}
func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
chatting_Textfield.resignFirstResponder()
return (true)
}
}
No comments:
Post a Comment