I am trying to add tap recognizer to show additional information callout. I tried calling the selector "showPersonInfo" directly and it's working. But, when I try to add it in a UITapGestureRecognizer on a subview of the MKAnnotationView I am working on. The selector is not firing when I tap.
This code is inside .m of a subclass of MKAnnotationView
- (void)layoutSubviews {
[self addSubView:self.imageContainerView];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showPersonInfo:)];
[self.imageContainerView addGestureRecognizer:tap];
}
- (void)showPersonInfo:(UITapGestureRecognizer *)tap {
NSLog(@"annotation imageView touched");
[self addSubview:self.personInfoView];
}