Touchesはswift3.0でクリックイベント処理を開始しました
Touchesbegan Click Event Handling Swift3
2017年3月13日
毎日、毎週= =
override func touchesBegan(_ touches: Set, with event: UIEvent?) { // Get the click event for touch: AnyObject in touches { let t:UITouch = touch as! UITouch let touchPoint = t.location(in: self.view) If self.testImageView.frame.contains(touchPoint) {// This excludes the range that does not need to trigger a click event (within rect) Print('This click will not respond!') }else { // Operate here } } }
転載:https://www.jianshu.com/p/733276319ad4