0

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 on how to do this easily?

Thank you!

Community
  • 1
  • 1
Fabiano Francesconi
  • 1,769
  • 1
  • 19
  • 35

1 Answers1

0

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

Ole Begemann
  • 135,006
  • 31
  • 278
  • 256