title: Keep the pin (MKAnnotation) on the center when user scroll the map
body: <p>I would like keep the MKAnnotaion on the centre of the screen when the user scoll the map like Careem app: </p>
  
  <p><img src="https://i.stack.imgur.com/E64JZ.png" alt="enter image description here"> </p>
  
  <p>So far I managed to show the pin, update the pin position but when I scroll the map, the annotation in my code initially moves and then gets back to the centre. I would like the pin to remain on the centre.</p>
  
  <pre><code>  @IBOutlet var mapView: MKMapView!
    var centerAnnotation = MKPointAnnotation()
    var manager:CLLocationManager!
  
   override func viewDidLoad() {
      super.viewDidLoad()
      manager = CLLocationManager() //instantiate
      manager.delegate = self // set the delegate
      manager.desiredAccuracy = kCLLocationAccuracyBest // required accurancy
  
      manager.requestWhenInUseAuthorization() // request authorization
      manager.startUpdatingLocation() //update location
  
      var lat = manager.location.coordinate.latitude // get lat
      var long = manager.location.coordinate.longitude // get long
      var coordinate = CLLocationCoordinate2DMake(lat, long)// set coordinate
  
      var latDelta:CLLocationDegrees = 0.01 // set delta
      var longDelta:CLLocationDegrees = 0.01 // set long
      var span:MKCoordinateSpan = MKCoordinateSpanMake(latDelta, longDelta)
      var region:MKCoordinateRegion = MKCoordinateRegionMake(coordinate, span)
  
      self.mapView.setRegion(region, animated: true)
      centerAnnotation.coordinate = mapView.centerCoordinate
      self.mapView.addAnnotation(centerAnnotation)
  }
  
  func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool) {
      centerAnnotation.coordinate = mapView.centerCoordinate;
  }
  </code></pre>
  
  <p>****UPDATE**** </p>
  
  <p>As suggested by Anna I have added a view to the map. Here the code: </p>
  
  <pre><code>var newPoint = self.mapView.convertCoordinate(mapView.centerCoordinate, toPointToView: self.view)
  
  
  
      var pinImage = UIImage(named: "yoga_pins.png")
      var imageView = UIImageView(image: pinImage) // set as you want
  
      imageView.image = pinImage
      imageView.backgroundColor = UIColor.clearColor()
      imageView.contentMode = UIViewContentMode.Center
      imageView.center.y = newPoint.y
      imageView.center.x = newPoint.x
  
  
      self.view.addSubview(imageView)
  </code></pre>
  
  <p>the only problem is that when the map is loaded the first time, the annotation which is located on the <code>mapView.centerCoordinate</code> and I am gonna use to get the latitude and longitude:</p>
  
  <p><img src="https://i.stack.imgur.com/1fnDA.png" alt="enter image description here"></p>
  
  <p>when I then scroll the map, the pin moves in the correct position (under the image):</p>
  
  <pre><code>    func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool) {
      centerAnnotation.coordinate = mapView.centerCoordinate;
  
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/VjnuD.png" alt="enter image description here"></p>