FInd the object from x,y in iOS
问题 How to find which UIElement is present in the window when (x,y) coordinates is given in iOS ? I will be having a view controller with many UI elements and I will be given x,y with which I have to find the element present in the view . 回答1: To get a list of views at a particular point you can use, -(NSArray*)subviewsAtPoint:(CGPoint)point inView:(UIView*)view { NSMutableArray *viewsAtPoint = [[NSMutableArray alloc]init]; for(UIView *subview in view.subviews) { if(CGRectContainsPoint(subview