以下のサイトを参考にさせていただき、MapKitを使って、長押しをした場所にピンを置くプログラムを書きました。 [逆引きswift][1] 長押しをすると同時に二つのAnnotationを置くようにしたかったのですが、最初の1つのAnnotationしか置くことができません。同時に二つのAnnotationを置くにはどうしたらいいでしょうか。 import UIKit import MapKit import CoreLocation class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate { @IBOutlet weak var mapView: MKMapView! let locationManager = CLLocationManager() //長押し検知器 var longtapGesture: UILongPressGestureRecognizer = UILongPressGestureRecognizer() override func viewDidLoad() { super.viewDidLoad() self.locationManager.delegate = self self.locationManager.desiredAccuracy = kCLLocationAccuracyBest self.locationManager.requestWhenInUseAuthorization() self.locationManager.startUpdatingLocation() self.mapView.showsUserLocation = true //長押し検知器の設定 //長押し時に呼びだすメソッド self.longtapGesture.addTarget(self, action: "longPressed:") //マップに長押し検知器を追加 self.mapView.addGestureRecognizer(self.longtapGesture) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } // MARK: - Location Delegate Methods func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let location = locations.last let center = CLLocationCoordinate2D(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude) let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 1, longitudeDelta: 1)) self.mapView.setRegion(region, animated: true) self.locationManager.stopUpdatingLocation() } func locationManager(manager: CLLocationManager, didFailWithError error: NSError) { print("Error: " + error.localizedDescription) } func longPressed(sender: UILongPressGestureRecognizer){ //指を離したときだけ反応するようにする if(sender.state != .Began){ return } //senderから長押しした地図上の座標を取得 let location = sender.locationInView(self.mapView) //CLLocationCoordinate2Dに変換 let mapPoint:CLLocationCoordinate2D = self.mapView.convertPoint(location, toCoordinateFromView: self.mapView) //ピンを生成 let theRoppongiAnnotation = MKPointAnnotation() //ピンを置く場所を設定 theRoppongiAnnotation.coordinate = mapPoint //ピンのタイトルの設定 theRoppongiAnnotation.title = "ピン1" //ピンのサブタイトルを設定 theRoppongiAnnotation.subtitle = "1個目のピン" // //ピンを地図上に追加 // self.mapView.addAnnotation(theRoppongiAnnotation) var newmapPoint:CLLocationCoordinate2D = self.mapView.convertPoint(location, toCoordinateFromView: self.mapView) //ピンを生成 let secondAnnotation = MKPointAnnotation() newmapPoint.longitude += 100 //ピンを置く場所を設定 secondAnnotation.coordinate = newmapPoint //ピンのタイトルの設定 secondAnnotation.title = "ピン2" //ピンのサブタイトルを設定 secondAnnotation.subtitle = "2個目のピン" //ピンを地図上に追加 self.mapView.addAnnotations([secondAnnotation,theRoppongiAnnotation]) } } [1]: https://sites.google.com/a/gclue.jp/swift-docs/ni-yinki100-ios/7-mapkit/pinnianimeshon