Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Sources/SkipKit/PermissionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,15 @@ class LocationDelegate: NSObject {
static let accuracyAuthorizationReducedAccuracy = 1

/// The shared `CLLocationManager` instance, or nil if the CoreLocation framework could not be loaded
lazy var locationManager: NSObject? = LocationDelegate.locationManagerClass()?.init()
lazy var locationManager: NSObject? = {
if Thread.isMainThread {
return LocationDelegate.locationManagerClass()?.init()
} else {
return DispatchQueue.main.asyncAndWait {
LocationDelegate.locationManagerClass()?.init()
}
}
}()

var continuation: CheckedContinuation<Void, Never>?

Expand Down
Loading