1

Simple question - I am trying to animate the change in heading for my map view, but haven't yet found a way to do this. I have tried using UIAnimation, but as I anticipated, this didn't work.

This is my code:

@IBAction func rotateToDefault(sender: AnyObject) {
        self.mapView.camera.heading = 0
}

Anyone have any suggestions?

user3746428
  • 11,047
  • 20
  • 81
  • 137

1 Answers1

2

You need to create a new MKMapCamera with the new heading and then animate to the new camera using setCamera: animated:

rmp
  • 3,503
  • 1
  • 17
  • 26