I have Some UIViews
that are displayed over an MKMapView
to serve as controls to filter the content of the map and my mapView have annotations that can show callout.I want to create an effect where my overlays will fade away if my callout appears or gets scrolled under the overlays and become visible again after the callout does not takes its place.
Is there a way to find out if the Callout of an MKMapView
is overlapping a UIView
?
I have tried:
- Accessing
frame
of Callout to check if it intersects the overlays - couldn't access callout.
- Calculating where the callout will appear and keeping track of the scrolling to calculate if the callout goes under the overlay - Unable to predict behaviour of callout appearing - how it shifts to avoid popping up outside the screen
- Making overlay controls take a separate screen space as map - map becomes too small, certain screen area becomes unoccupied as controls do not take up a rectangular space. Will use this as last resort if no solution to my problem.
Edit
I made a gif of the effect I wanted
The Blue square will represent the controls and the red represent the callout, basically I want to make my overlay controls of my map fade away when the callout goes under it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…