0
저는 현재 작업중인 애플리케이션에 Google Maps iOS SDK를 사용하고 있습니다. 이제 응용 프로그램이 포 그라운드로 반환되거나 사용자가지도보기로 돌아 왔을 때 사용자의 현재 위치에지도를 다시 작성해야합니다. 나는 수색을하고 몇 가지를 시도했지만 아무 것도 효과가 없었다.Swift를 사용하여 앱이 포 그라운드로 돌아 왔을 때 Google지도를 다시 작성하십시오.
CoreLocation 스택의 "didUpdateLocations"처리기에 코드를 삽입하려했지만 작동하지 않았습니다. 동시에 viewWillAppear 함수는 응용 프로그램이 포 그라운드로 다시 가져 왔을 때 호출되지 않으므로 작동하지 않습니다.
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let camera = GMSCameraPosition.camera(withLatitude: (manager.location!.coordinate.latitude), longitude: (manager.location!.coordinate.longitude), zoom: 16.0)
self.mapView?.animate(to: camera)
}
도움을 주시면 감사하겠습니다.