Skip to content

Instantly share code, notes, and snippets.

@phucnm
Created October 9, 2017 09:16
Show Gist options
  • Save phucnm/b91b5463fe7d88be4bf4fb83c319265f to your computer and use it in GitHub Desktop.
Save phucnm/b91b5463fe7d88be4bf4fb83c319265f to your computer and use it in GitHub Desktop.
PassthroughViewToWindow
class PassthroughToWindowView: UIView {
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
var view = super.hitTest(point, with: event)
if view != self {
return view
}
while !(view is PassthroughWindow) {
view = view?.superview
}
return view
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment