0
votes

I have the followinf hierarchy in my screen ViewController(green bellow the red and blue) that has two subviews that "cover" the area of the UIviewController view

enter image description here

the blue view is a google map (GMSMapView)

I have another UIView (Black) that has a tapgesture attached to it, on tap it removes itself from its superview.

if I add black to my viewcontrollerview as a subview (adding black to green) then everything works fine

but if I add black to the map (the blue) then the tapgesture is not being called

any Ideas on why that is?

Note: the Map gesture work perfectly.

1
Maybe the GMSMapView captures the gesture and stops it from going downward? You could just size and position the view over the top of it instead.Toby
@Toby nop I have a didTap methods for the map they are not fired eitherliv a
You don't know how Google map's view is coded, so there might be weird interactions happening that might not be entirely obvious, perhaps? A workaround is to place google map in another container view and add your black view in that instead.Flying_Banana

1 Answers

0
votes

Since the mapView gestures are not fired as well I'm assuming userInteractions are not enabled for subviews.
For every subView you would need to do this: self.subviewOfInterest.userInteractionEnabled = YES;. It is set to NO by default.

This answer has more explanation.