0

I am using custom annotation view (Objective c)in which I have also added a view which consists of label and image, and when a user clicks on that view we have to move him on different view controller. To perform this I have added a UIButton having same height and width of custom view (which consist label and image view) and added it to annotation view, also I have added that custom view on annotation view. But the action method I have written corresponding to that button is not get called. I have checked the button by giving its background color and it is visible in annotation view. but, the functionality didn't call.

Can anyone help?

Harsh
  • 63
  • 9
  • Your button will not work directly unless you set Hit-test for your custom annotation. I had the same issue but [this](https://stackoverflow.com/a/30824051/3308174) answer got me jumping on the map – Pratik Jamariya Nov 20 '17 at 12:48
  • @PratikJamariya thanks, but as I am using the custom annotation view, and also added a custom view along with annotation view. that's why the button click is not working. – Harsh Nov 21 '17 at 06:01
  • your button won't work until you add hit-test to your annotation view – Pratik Jamariya Nov 21 '17 at 06:02
  • @PratikJamariya yes I tried to do the same, but unable to implement. do you have any code which will work in my situation? – Harsh Nov 21 '17 at 06:21
  • In your situation? and what is that? can you post your code? – Pratik Jamariya Nov 21 '17 at 06:22
  • I guess the link i posted on my previous comments has everything that you need? – Pratik Jamariya Nov 21 '17 at 06:23

0 Answers0