📅  最后修改于: 2022-03-11 15:00:58.494000             🧑  作者: Mango
//Reason for this could be, you are using a pan gesture in the view. like AAA mentioned removing your pan gesture will do the trick. But if you still want to use the pan gesture you could do the following
let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "dismissKeyboard")
view.addGestureRecognizer(tap)
tap.cancelsTouchesInView = false
//Making cancelsTouchesInView, false will enable all you taps.