Can I get a subView at a specific point in the supervisor?

I want something like

-(UIView*) fromPoint: (CGPoint) point inView:(UIView*) superView 

Is something like this already present? I want to be able to successfully replace the contents of any two of the UIImageView out of many, if you drag and drop them onto another.

One way to do this is to check all child objects if they contain the provided point. Is there another way?

Thanks.

+4
source share
1 answer

Running hitTest on a UIView will return a subheading if the hit test is displayed in its hierarchy

 - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event 

event will be null for what you want

+5
source

All Articles