user4951
user4951

Reputation: 33140

How to Pass on Touches of a View to It's Parent Map

To indicate distance I draw a circle on top of MKMapview.

The problem is that circle get in the way of MKMapview. When that circle is around I can't easily zoom in or zoom out MKMapview.

How can I tell that cirlce to just pass all touch events to the parent namely MKMapview.

Upvotes: 0

Views: 93

Answers (2)

myell0w
myell0w

Reputation: 2200

if your circle is an instance of UIView you can simple disable user interaction on it:

circle.userInteractionEnabled = NO;

that way the circle won't receive any touch events and the mapView will handle them.

Upvotes: 1

Julien
Julien

Reputation: 3477

Take a look at UIView method:

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event

From -hitTest:withEvent: documentation:

"If pointInside:withEvent: returns YES, then the subview’s hierarchy is traversed; otherwise, its branch of the view hierarchy is ignored."

Upvotes: 1

Related Questions