I have a UI element. When I tap it, it animates to an intermediary state. A tap anywhere else on the screen should cancel the interaction, while another tap on the UI element should proceed.
I've implemented this using a guard view (subview of window & above every other subview) and then reparenting the element into the guard view before the animation, but I'm curious as to what other ways people can think of doing this, that might be cleaner.
I've thought of using a guard window instead of a view, and messing with hitTest:withEvent:
and pointInside:forEvent:
. The problem with those two is that the superview of the element does not take up the whole screen.
This sounds like a perfect use case for what exclusiveTouch
sounds like (all touch events anywhere go to that view), but in reality isn't (all touch events started in that view only go to that view, and not other views at the same time).
Thoughts?