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.camera(withLatitude: userLocation!.coordinate.latitude,
longitude: userLocation!.coordinate.longitude, zoom: 13.0)
mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
mapView.isMyLocationEnabled = true
self.view = mapView
locationManager.stopUpdatingLocation()
let Lat = "\(userLocation!.coordinate.latitude)"
let Long = "\(userLocation!.coordinate.longitude)"
}
How do I extract the values of Lat and Long out of the function? I've attempted a return and also tried sending the values to the app delegate to be later called back but nothing worked. The values get passed to the app delegate but are not able to be called back into the same VC they came from. I'm new to swift so I sure there has to be a simpler method of getting them out that I'm overlooking.