It all depends on what caused the appearance of the keyboard in the first place. If your page has a UITextField , you can call textField.resignFirstResponder() to hide the keyboard again.
If you used any other object to call the keyboard, just use the link to everything you used and call resignFirstResponder() on that object.
Example:
Suppose you use the button button1 to close the keyboard, and you have textField1 that launches the keyboard.
button1.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "buttonTapped"))
Then in buttonTappedFunction
func buttonTapped(){ textField1.resignFirstResponder() }
Unome source share