If you have two text inputs in a container view, calling container.blur() could make both of the text inputs try to resign their first responder status. In UIKit this is built-in as -[UIView endEditing:animated]. This way you can just blur the root view if you want the keyboard to go away.