title: MKAnnotationView with custom view and image view
body: <p>In my Map application, instead of showing a pin, I want to show a colored background circle with image in it. The color of the background (which is shade of green in below image) circle is dynamic. It will look as in below image:
  <br></p>
  
  <p><img src="https://i.stack.imgur.com/N6BU6.png" alt="enter image description here"></p>
  
  <p>I created TCircleView which draws the color in "drawRect"<br><br>
  To show similar annotation, I created object of TCircleView and UIImageView and add them to MKAnnotationView object. Its looking good and visible as expected.<br><br>
  But its not allowing to detect tap/touch to show the call out.</p>
  
  <p>I'm using the below code:</p>
  
  <pre><code>- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id&lt;MKAnnotation&gt;)annotation {
  
      if ([annotation isKindOfClass:[MKPointAnnotation class]]) {
          return nil;
      }
  
      static NSString *annotationIdentifier = @"StickerPin";
  
      MKAnnotationView *annotationView = (MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier];
  
      if (!annotationView) {
          annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationIdentifier];
          annotationView.canShowCallout = YES;
      }
  
      TCircleView* circleView = [[TCircleView alloc] init];
      circleView.green = [postObj[@"severity"] floatValue]; //dynamic value coming from server
  
      UIImageView* imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Piano"]];
  
      CGRect r = imgView.frame;
      r.size.height = r.size.width = 60;
      imgView.frame = r;
      circleView.frame = r;
  
      [annotationView addSubview:circleView];
      [annotationView addSubview:imgView];
  
      return annotationView;
  }
  </code></pre>
  
  <p>Its not allowing to show the callout or not even calling the delegate "didSelectAnnotationView:"
  <br>
  How to show the custom view as annotation on the map?</p>