iOS -MKMapView -Перетаскиваемые аннотации

У меня есть готовая аннотация, но я пытаюсь понять, как сделать ее перетаскиваемой с помощью моего кода:

-(IBAction) updateLocation:(id)sender{

    MKCoordinateRegion newRegion;

    newRegion.center.latitude = mapView.userLocation.location.coordinate.latitude;
    newRegion.center.longitude = mapView.userLocation.location.coordinate.longitude;

    newRegion.span.latitudeDelta = 0.0004f;
    newRegion.span.longitudeDelta = 0.0004f;

    [mapView setRegion: newRegion animated: YES];


    CLLocationCoordinate2D coordinate;
    coordinate.latitude = mapView.userLocation.location.coordinate.latitude;
    coordinate.longitude = mapView.userLocation.location.coordinate.longitude;

    MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];

    [annotation setCoordinate: coordinate];
    [annotation setTitle: @"Your Car is parked here"];
    [annotation setSubtitle: @"Come here for pepsi"];


    [mapView addAnnotation: annotation];
    [mapView setZoomEnabled: YES];
    [mapView setScrollEnabled: YES];
}

Заранее спасибо!

7
задан Meet Doshi 20 May 2017 в 11:47
поделиться