swift – Why is iOS 16/Xcode 14 inflicting UI responsiveness points for apps that use location companies and adMob?

[ad_1]

I get this error:

This technique could cause UI unresponsiveness if invoked on the primary thread. As a substitute, take into account ready for the -locationManagerDidChangeAuthorization: callback and checking authorizationStatus first.”?

Earlier than iOS 16 UI was positive, now it certainly appears laggy.

Apparently it’s linked to AdMob. Google says it’s a bug with Apple. https://developer.apple.com/boards/thread/714467

Worst half is that in testing I truly assume it does trigger UI Unresponsiveness. I actually do not assume ready for an replace is an effective answer. Have any of you had this and carried out one thing to repair it?

That is how my code appears to be like:

**      if CLLocationManager.locationServicesEnabled() {
        let authorizationStatus: CLAuthorizationStatus
        if #obtainable(iOS 14, *) {
            authorizationStatus = locationManager.authorizationStatus
        } else {
            authorizationStatus = CLLocationManager.authorizationStatus()
        }

        swap authorizationStatus {
        case .authorizedAlways, .authorizedWhenInUse:
        case .notDetermined:
        case .restricted:
        case .denied:
        @unknown default:
            print("Location companies aren't enabled")
}

**

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *