MKPinAnnotationViewとsetDragAbleを追加します。私のコードはここにあります
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
MKPinAnnotationView *annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pin"];
[annotationView setDraggable:YES];
annotationView.pinColor = MKPinAnnotationColorPurple;
return [annotationView autorelease];
}
わかりました、ピンをドラッグできます。
しかし、1つの問題は、それが1回のタップだけではないということです。常に2回目のタップが必要です。
最初にピンをタップするが選択されているがドラッグできないとき。もう一度タップすると、ドラッグが利用可能になります。
どうしたの?「Map.app」のようにワンタップでドラッグしたい