malcommac / SwiftLocation

⚓️ Async/Await CLLocationManager Wrapper for Apple Platforms
MIT License
3.39k stars 432 forks source link

[Bug]: Main thread warning #385

Open ucerxxx opened 4 months ago

ucerxxx commented 4 months ago

Platform Version

17.0-17.4

SDK Version

6.0.0

Xcode Version

15.3

Steps To Reproduce

On init of Location: Location() Xcode produce a warning. Even without accessing any properties of Location object or calling any functions.

Expected Behavior

No warnings)

Actual Incorrect Behavior

`extension CLLocationManager: LocationManagerProtocol {

public func locationServicesEnabled() -> Bool {
    CLLocationManager.locationServicesEnabled()
}

... Xcode produce warning: This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the-locationManagerDidChangeAuthorization:callback and checkingauthorizationStatus` first.

dpyy commented 1 month ago

is there any workaround for this please?