Search code examples
iosswiftcllocationmanagergmsmapview

Location Manager interrupting GMSMapView


I am facing a very unusual issue. Location manager is interrupting in GMSMapView functions. GMSCamera moves perfect when i comment my Location Manager init code. But when i uncomment location manager code this code doesn't moves the camera position.

I've tried this code

 let cameraPostition = GMSCameraPosition.camera(withLatitude:
 kUserLatitude, longitude: kUserLongitude, zoom: 10.0) 

 mapView.animate(to: cameraPostition)

and this also

 mapView.camera = GMSCameraPosition.camera(withLatitude: kUserLatitude,
 longitude: kUserLongitude, zoom: 10.0)

but all in vein. Even i've tried

 locationManager.stopUpdatingLocation()

Help in getting through this issue. Thanks in advance


Solution

  • This ended up my problem, by editing my scheme and unchecking "Allow location Simulation" Hope it may help anyone wandering around :)

    enter image description here