1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {

for touch:AnyObject in touches {
let t:UITouch = touch as! UITouch
//检测当前触摸的view是否是textField
if t.view == pwdField || t.view == pwdField || t.view == phoneField{
t.view?.becomeFirstResponder()
}else{
phoneField.resignFirstResponder()
pwdField.resignFirstResponder()
verificationField.resignFirstResponder()
self.resignFirstResponder()
}
}

}