Skip to content

Instantly share code, notes, and snippets.

@khanlou
Created June 14, 2018 22:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khanlou/dc9d26d2bd4445a63338c0941b6d68e3 to your computer and use it in GitHub Desktop.
Save khanlou/dc9d26d2bd4445a63338c0941b6d68e3 to your computer and use it in GitHub Desktop.
import UIKit
class PassThroughView: UIView {
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