I have a decimal pad that appears after I pressed a UIButton.
I have overridden touchesBegan
method like the following:
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
self.view.endEditing(true)
}
It works fine as long as for example I don't press another UIButton
for example.
My question: is there a way to make my decimal pad disappear other than to make it disappear when I am handling the other UIButton
's action? Like if I have 10 other UIButton
, it would be a bit annoying to specify every time "of by the way, before you execute your code, check if by any chance the decimal pad is hidden or not"