I get this error:
This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the
-locationManagerDidChangeAuthorization:
callback and checkingauthorizationStatus
first.
Before iOS 16 UI was fine, now it indeed seems laggy.
Apparently it is linked to AdMob. Google says it is a bug with Apple. https://developer.apple.com/forums/thread/714467
Worst part is that in testing I actually think it does cause UI Unresponsiveness
. I really don't think waiting for an update is a good solution.
Have any of you had this and done something to fix it?
This is how my code looks:
if CLLocationManager.locationServicesEnabled() {
let authorizationStatus: CLAuthorizationStatus
if #available(iOS 14, *) {
authorizationStatus = locationManager.authorizationStatus
} else {
authorizationStatus = CLLocationManager.authorizationStatus()
}
switch authorizationStatus {
case .authorizedAlways, .authorizedWhenInUse:
case .notDetermined:
case .restricted:
case .denied:
@unknown default:
print("Location services are not enabled")
}