I’m trying to hide a pin on a MapKit view, and while setting the hidden property to YES works, I can still tap on it and get didSelectAnnotationView messages!. Naturally, I tried setting userInteractionEnabled to NO, but I’m still receiving the messages.
This is what I’ve tried. a is my annotation view.
a.hidden = YES;
a.layer.hidden = YES;
a.userInteractionEnabled = NO;
There’s something that I’m missing here, and I’ve Googled everywhere and can’t find anything that works. Any clues?
The
enabledproperty ofMKAnnotationViewcan be set toNOto disable selection as the documentation states: