Created
March 9, 2016 13:50
-
-
Save longlongjump/74fa1ef3fb68b007b711 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OverlayView: UIView { | |
weak var targetView: UIView? | |
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { | |
super.touchesBegan(touches, withEvent: event) | |
targetView?.touchesBegan(touches, withEvent: event) | |
} | |
override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) { | |
super.touchesMoved(touches, withEvent: event) | |
targetView?.touchesCancelled(touches, withEvent: event) // its important to cancel touch to proper unhighlight cell | |
} | |
override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) { | |
super.touchesEnded(touches, withEvent: event) | |
targetView?.touchesEnded(touches, withEvent: event) | |
} | |
override func touchesCancelled(touches: Set<UITouch>?, withEvent event: UIEvent?) { | |
super.touchesCancelled(touches, withEvent: event) | |
targetView?.touchesCancelled(touches, withEvent: event) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment