diff --git a/RELEASE.md b/RELEASE.md index ab72f8d..33bec07 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1 +1,3 @@ # Release 1.0.1 + +* [Bug fix](https://github.com/Esri/maps-app-ios/issues/89) to dispatch UI updates to main thread. diff --git a/maps-app-ios/UI/Map View/MapViewController+GPS/MapViewController+LocationDisplay.swift b/maps-app-ios/UI/Map View/MapViewController+GPS/MapViewController+LocationDisplay.swift index 5edb282..999a9bc 100644 --- a/maps-app-ios/UI/Map View/MapViewController+GPS/MapViewController+LocationDisplay.swift +++ b/maps-app-ios/UI/Map View/MapViewController+GPS/MapViewController+LocationDisplay.swift @@ -22,9 +22,12 @@ extension MapViewController { } } - mapView.locationDisplay.autoPanModeChangedHandler = { newAutoPanMode in + mapView.locationDisplay.autoPanModeChangedHandler = { [weak self] newAutoPanMode in print("New autoPanMode: \(newAutoPanMode)") - self.gpsButton.setImage(self.mapView.locationDisplay.getImage(), for: .normal) + DispatchQueue.main.async { + guard let self = self else { return } + self.gpsButton.setImage(self.mapView.locationDisplay.getImage(), for: .normal) + } } }