Created
October 9, 2017 09:16
-
-
Save phucnm/b91b5463fe7d88be4bf4fb83c319265f to your computer and use it in GitHub Desktop.
PassthroughViewToWindow
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 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