The corresponding code is as follows:
class GameViewController: UIViewController, UITextFieldDelegate { ... override func touchesBegan(touches: SetAdditionally, if you have any buttons with IBActions attached to them you may need to have the line self.view.endEditing(true) in these also., withEvent event: UIEvent?) { self.view.endEditing(true) } func textFieldShouldReturn(textField: UITextField) -> Bool { textField.resignFirstResponder() return true } ... }
No comments:
Post a Comment