Skip to content

Instantly share code, notes, and snippets.

@arturlector
Created February 15, 2018 11:56
Show Gist options
  • Save arturlector/9241f8f567ba7d1bbbb4e4aa2ad02b73 to your computer and use it in GitHub Desktop.
Save arturlector/9241f8f567ba7d1bbbb4e4aa2ad02b73 to your computer and use it in GitHub Desktop.
Ignore the view itself, but still deliver touches to its subviews
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let result = super.hitTest(point, with: event)
if result == self { return nil }
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment