Skip to content

Instantly share code, notes, and snippets.

@ngengesenior
Created June 12, 2024 19:30
Show Gist options
  • Save ngengesenior/3d12be7768f85506af5ec5affb36301e to your computer and use it in GitHub Desktop.
Save ngengesenior/3d12be7768f85506af5ec5affb36301e to your computer and use it in GitHub Desktop.
override fun locationManager(manager: CLLocationManager, didFailWithError: NSError) {
locationPermissionStatusCancellableContinuation?.let {
if (it.isActive) {
it.resume(LocationPermissionStatus.RESTRICTED_OR_DENIED)
locationPermissionStatusCancellableContinuation = null
}
}
locationResultContinuation?.let {
if (it.isActive) {
it.resumeWithException(Exception("Failed to get location,description:${didFailWithError.localizedDescription},code:${didFailWithError.code}"))
locationResultContinuation = null
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment