Is there a way to quickly get what views are are at (contain) the specific point of a UITouch? I have the coordinates relative to self.view but would like to know any/all of the views that are at that point. My view hierarchy is similar to
You can use the CGRectContainsPoint()
method.
This method will return a boolean value.
You need to pass the views frame(CGRect
) and the coordinates relative to touch(CGPoint
).
Also you can check with this method too,
CGPoint aPoint = //your touch point;
BOOL isPointInsideView = [yourView pointInside:aPoint withEvent:nil];
Here the given point (aPoint
) is checked with the view you are giving (yourView
) and returns a boolean value.