Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to detect a callout of an annotation is showing on mapview?

I have a checkin related app. When user clicks a venue on map, callout will popup and show its name and address. At the same time, if the venue is within 1000m from current location, a check in button will be displayed.

To a venue that can checkin, all I want is,

when callout is popup, check in button shows. when callout is disappear, that button disappears too.

Now show button works well, but I don't know how to detect callout visible status. Is there any callback method that callout show/hide?

Thanks in advance!

like image 205
LetBulletFlies Avatar asked Mar 24 '11 13:03

LetBulletFlies


2 Answers

Callout appears when annotation is selected - you can use mapView:didSelectAnnotationView: method in delegate to track that event. Callout hides when annotation is deselected - use mapView:didDeselectAnnotationView: method to track that event.

like image 85
Vladimir Avatar answered Nov 14 '22 23:11

Vladimir


As you can see here it is about selected property of MKAnnotationView, which is saying that If the property contains YES, the annotation view is displaying a callout bubble.

You may additionally implement an observer for this property, to implement your functionality.

like image 26
Oleg Danu Avatar answered Nov 14 '22 21:11

Oleg Danu