title: Current Location in Google Maps with swift
body: <p>I'm trying to display the user's current location on a google map but in the case below, the map doesn't even get displayed. What should I change to fix this?  </p>
  
  <pre><code>var locationManager = CLLocationManager()
  
  override func viewDidLoad() {
      super.viewDidLoad()
      // Do any additional setup after loading the view.
  
      //user location stuff
      locationManager.delegate = self
      locationManager.requestWhenInUseAuthorization()
      locationManager.desiredAccuracy = kCLLocationAccuracyBest
      locationManager.startUpdatingLocation()
  }
  
  func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
      print("Error" + error.description)
  }
  
  func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
      let userLocation = locations.last
      let center = CLLocationCoordinate2D(latitude: userLocation!.coordinate.latitude, longitude: userLocation!.coordinate.longitude)
  
      let camera = GMSCameraPosition.cameraWithLatitude(userLocation!.coordinate.latitude,
          longitude: userLocation!.coordinate.longitude, zoom: 8)
      let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)
      mapView.myLocationEnabled = true
      self.view = mapView
  
      let marker = GMSMarker()
      marker.position = center
      marker.title = "Current Location"
      marker.snippet = "XXX"
      marker.map = mapView
  
      locationManager.stopUpdatingLocation()
  }
  </code></pre>