title: Issues with map view camera heading
body: <p>I am having issues with the order/way that I'm setting up my <code>UIMapView</code>. This is what I would like to happen:</p>
  
  <p>View appears - Map rotates to specified heading</p>
  
  <p>Reset button tapped - If user has moved the map, it will reset to the default heading and zoom</p>
  
  <p>At the moment the map is rotated to the heading when the map appears, but the reset button does nothing. I suspect this is down to the order I am doing things because if I flip two lines of code around, it works, but it doesn't rotate to the correct heading when the map appears.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@IBAction func rotateToDefault(sender: AnyObject) {
      mapView.setRegion(zoomRegion, animated: true)
      mapView.camera.heading = parkPassed.orientation!
  }
  
  override func viewWillAppear(animated: Bool) {
      setUpMapView()
  }
  
  override func viewDidAppear(animated: Bool) {
      mapView.setRegion(zoomRegion, animated: true)
      mapView.camera.heading = parkPassed.orientation!
  }
  
  func setUpMapView() {
      rideArray = ((DataManager.sharedInstance.rideArray) as NSArray) as! [Ride]
  
      zoomRegion = MKCoordinateRegionMakeWithDistance(CLLocationCoordinate2D(latitude: parkPassed.latitude!, longitude: parkPassed.longitude!), 1000, 1000)
      mapView.setRegion(zoomRegion, animated: true)
      mapView.delegate = self
  
      for ride in rideArray {
          var subtitle = ""
          if locationManager.location == nil {
              subtitle = "Distance unavailable"
          } else {
              let userLocation = CLLocation(latitude: locationManager.location.coordinate.latitude, longitude: locationManager.location.coordinate.longitude)
              let annotationLocation = CLLocation(latitude: ride.latitude!, longitude: ride.longitude!)
  
              var distance = Int(CLLocationDistance(annotationLocation.distanceFromLocation(userLocation)))
  
              if distance &gt; 1000 {
                  distance = distance / 1000
                  subtitle = "\(distance) kilometers"
              } else {
                  subtitle = "\(distance) meters"
              }
          }
  
          let annotation = RideAnnotation(coordinate: CLLocationCoordinate2DMake(ride.latitude!, ride.longitude!), title: ride.name!, subtitle: subtitle)
          self.qTree.insertObject(annotation)
          annotationsAdded.insertObject(annotation, atIndex: 0)
  
          println(qTree.count)
      }
  }
  </code></pre>
  
  <p>Anyone have any suggestions?</p>