title: Custom MKAnnotation callout bubble with button
body: <p>I'm developing app, where user is localized by gps and then he is asked, whether he is located in specific place. To confirm this, callout bubble is presented to him straight away, asking him, if he is at specific place. </p>
  
  <p>As there is alot of similar questions, I was able to do custom callout bubble:
  <img src="https://i.stack.imgur.com/Jj9Vc.png" alt="Custom callout bubble"></p>
  
  <p>My problem: button is not "clickable"
  My guess: because this custom callout is higher than standard callout bubble, I had to place it in negative "frame", therefore button cannot be clicked. Here is my <code>didSelectAnnotationView</code> method </p>
  
  <pre><code>- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view {
      if(![view.annotation isKindOfClass:[MKUserLocation class]]) {
          CalloutView *calloutView = (CalloutView *)[[[NSBundle mainBundle] loadNibNamed:@"callOutView" owner:self options:nil] objectAtIndex:0];
          CGRect calloutViewFrame = calloutView.frame;
          calloutViewFrame.origin = CGPointMake(-calloutViewFrame.size.width/2 + 15, -calloutViewFrame.size.height);
          calloutView.frame = calloutViewFrame;
          [calloutView.calloutLabel setText:[(MyLocation*)[view annotation] title]];
          [calloutView.btnYes addTarget:self
                                 action:@selector(checkin)
                       forControlEvents:UIControlEventTouchUpInside];
          calloutView.userInteractionEnabled = YES;
          view.userInteractionEnabled = YES;
          [view addSubview:calloutView];
      }
  
  }
  </code></pre>
  
  <p>CalloutView is just simple class with 2 properties(label that shows name of place and button) and with xib.</p>
  
  <p>I have been doing this custom callout bubble for a few days. I tried using "asynchrony solutions" <a href="http://blog.asynchrony.com/2010/09/building-custom-map-annotation-callouts-part-2/" rel="noreferrer">solution</a> but I was unable to add any other kind of button then disclosure button.</p>
  
  <p>My next attempt, was to find something that was easier than asynchrony solutions and modify it to my use. Thats how I found <a href="https://github.com/tochi/custom-callout-sample-for-iOS" rel="noreferrer">tochi's custom callout</a>. </p>
  
  <p><img src="https://i.stack.imgur.com/rc8QP.png" alt="Tochi&#39;s custom callout"></p>
  
  <p>Based on his work, I was able to customize his bubble and change info button for my custom button. My problem however remained the same. In order to place my custom callout view on top of the pin, I had to give it negative frame, so my button was "clickable" only in bottom 5 pixels. It seems, that I have to maybe dig deeper into ios default callout bubble, subclass it and change frame of callout in there. But I'm really hopeless now.</p>
  
  <p>If you guys could show me the right way, or give me advice, I'll be glad.</p>