开发者

How to forward touches to MKMapView

how do I forward touches from the parent view that, in my case, is a MKMapView?

The idea, basically, is to splash a view with a spinner that is semi-transparent but I, also, want the user to move the map beyond this view. I just want to pretend the view isn't there and this view just forwards the touches on the parent view (since this spinner view is a subview of MKMapView).

I found a bad way to do that (I sincerely haven't tried it and I don't think I will) that is using some undocumented APIs:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    UIScrollView * view = [[[[mapView subviews] objectAtIndex:0] subviews] objectAtIndex:0];
    [view touchesMoved:touches withEvent:event];
}

I have also found the WildcardGestureRecognizer approach as discussed HERE but I think it is so much powerful compared to the trivial goal I am trying to achieve.

Any ideas o开发者_如何学编程n how to do this easily?

Thank you!


I believe it is enough to set userInteractionEnabled = NO on the overlay view. IIRC, the underlying view will then receive the touches.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜