Cancel network activity when told to shutdown by the OS. Issue #1232

This commit is contained in:
Maurice Parker
2019-11-04 20:24:21 -06:00
parent 219e5751a1
commit c6e3ed6692
14 changed files with 232 additions and 71 deletions

View File

@@ -16,7 +16,11 @@ struct ErrorHandler {
public static func present(_ viewController: UIViewController) -> (Error) -> () {
return { [weak viewController] error in
viewController?.presentError(error)
if UIApplication.shared.applicationState == .active {
viewController?.presentError(error)
} else {
ErrorHandler.log(error)
}
}
}