SwiftLocation
SwiftLocation copied to clipboard
Error Processing
In the case of:
SwiftLocation.gpsLocation(accuracy: .neighborhood).then { result in
switch result {
case .success(let locationData):
do some successfull processing
case .failure( _):
do some failure processing
}
}
How do you handle error processing where the result callback is not returned (such as the user stating Don't Allow)? I did not see that identified in the documentation.
SwiftLocation.gpsLocation(accuracy: .neighborhood).then { result in
switch result {
case .success(let locationData):
print(locationData)
case .failure(let error):
switch error {
case .authorizationNeeded:
//do some failure processing
break
default:
break
}
}
}
No, if the user selects Don't Allow, it will not fail into .failure case.
Same here! iOS 15 real device iPhone 12 Pro. Quite important feature.