I'm running into a strange issue that only occurs on iOS 27.
I have a basic
LocationManagerimplementation:import Foundation import CoreLocation import UIKit class LocationManager: NSObject, CLLocationManagerDelegate { static let shared = LocationManager() private let manager = CLLocationManager() private let geocoder = CLGeocoder() // MARK: - Public API func fetchLocationIfNeeded() { manager.delegate = self handleAuthorization(CLLocationManager.authorizationStatus()) } private func handleAuthorization(_ status: CLAuthorizationStatus) { switch status { case .notDetermined: manager.requestWhenInUseAuthorization() case .restricted, .denied: showLocationPermissionAlert() case .authorizedWhenInUse, .authorizedAlways: manager.desiredAccuracy = kCLLocationAccuracyThreeKilometers manager.requestLocation() @unknown default: break } } private func showLocationPermissionAlert() { let alertController = UIAlertController( title: "Location Access Required", message: "Please enable location access in Settings to use this feature.", preferredStyle: .alert ) alertController.addAction(UIAlertAction(title: "Open Settings", style: .default, handler: { _ in if let settingsURL = URL(string: UIApplication.openSettingsURLString) { UIApplication.shared.open(settingsURL) } })) if let topController = UIApplication.shared.windows.first?.rootViewController { topController.present(alertController, animated: true) } } func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { handleAuthorization(status) } // MARK: - Location func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { guard let location = locations.first else { return } geocoder.reverseGeocodeLocation(location) { placemarks, error in guard error == nil, let postalCode = placemarks?.first?.postalCode, !postalCode.isEmpty else { return } print("zipcode :", postalCode) globalZipCode = postalCode NotificationCenter.default.post( name: NSNotification.Name("ZipcodeGet"), object: nil ) } } func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { print("Location error: ", error.localizedDescription) } }On iOS 27, the app appears to freeze before
handleAuthorization(_:)is entered.The line that seems to trigger the issue is:
handleAuthorization(CLLocationManager.authorizationStatus())When I inspect the value in the debugger, I get the following output the first time:
po CLLocationManager.authorizationStatus() warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.Running the same command again produces:
po CLLocationManager.authorizationStatus() __C.CLAuthorizationStatusI've already confirmed that the required permission key exists in
Info.plist:NSLocationWhenInUseUsageDescription We use your location to determine your ZIP code. The exact same implementation works correctly in older apps, and the issue only appears in this project on iOS 27
Has anyone seen a similar issue or knows if there are any changes to
CLLocationManager.authorizationStatus()or location authorization handling in iOS 27?