I'm looking for a way to test if a UIView is (partially) obscured by an UIActionSheet, UIAlertView, HUD, etc., or if it is (partially) off the screen in a sliding panel, UIScrollView, etc.. This needs to be a generic solution because there are too many ways to obscure a view.
What comes to mind is to perform a few hit tests at key points where the UIView should be and check how many, if any, hit the given UIView.
Example: Imagine there is no hand in the image below. I'd like to perform a programmatic hit test at the point where the finger is. If View A.2
is not returned, then it is obscured.
I've looked into hit tests with touch events, but how can I programmatically perform a hit test and see which UIView is hit without physical touch events?
References: