PopOver to view annotations

Well, do I have a question? Im Confuse!

I have a mapview where annotations are laid out. Now I want a popover for annotations.

How can I do it

1.Create a popover controller in the storyboard and click it from the delgate method. 2.Create a software popover view for all subviews, etc.?

I want to use the first method that will help me.

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control 

{ // UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"annotationPopUp"]; [self performSegueWithIdentifier: @"annotationPush" sender:nil]; }

+4
source share
1 answer

In mapView:didSelectAnnotationView make your popover (preferably a property) in your class and click on it. Here is an example:

 - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view { self.popover = [[UIPopoverController alloc] initWithContentViewController:yourViewController]; [self.popover presentPopoverFromRect:view.bounds inView:view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; } 
+3
source

Source: https://habr.com/ru/post/1445810/


All Articles