标签:tracking can swift 点击事件 field bind resign get sel
self.view.addGestureRecognizer(UITapGestureRecognizer(target:self, action:#selector(你的viewcontroller.handleTap(sender:))))
//对应方法
func handleTap(sender: UITapGestureRecognizer) {
if sender.state == .ended {
你的textfield.resignFirstResponder()
}
sender.cancelsTouchesInView =false
}
标签:tracking can swift 点击事件 field bind resign get sel
原文地址:http://www.cnblogs.com/-ios/p/7279319.html