As you can see below, I have an annotation in which there is a right button. When the user enters the right button, I present a popover - the problem is that I don’t know where the user knocked, so I don’t have X and Y to display the popover accordingly.
How to find out where the user knocked, i.e. X and Y?
HotelAnnotationView *customPinView = [[HotelAnnotationView alloc] initWithAnnotation:theHotel reuseIdentifier:hotelPin];
UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[rightButton addTarget:self action:@selector(showDetailsForHotel:) forControlEvents:UIControlEventTouchUpInside];
rightButton.tag = theHotel.id;
customPinView.rightCalloutAccessoryView = rightButton;
source
share