I am using this code to detect when UIButton
and UIImageView
are overlapping:
CGPoint fingerPoint = [(UIPanGestureRecognizer*)sender locationInView:imageA.superview];
if (CGRectContainsPoint(imageA.frame, fingerPoint)) {
NSLog(@"Do something");
}
The code works fine, but I have images B, C, D, E.
How can I loop over a collection of them and move CGRectContainsPoint()
into the body of that loop?