Removed usaged of UIApplication.present

This commit is contained in:
Maurice Parker
2019-06-27 14:21:07 -05:00
parent 95d4395416
commit 5f045706e4
9 changed files with 28 additions and 29 deletions

View File

@@ -14,10 +14,12 @@ struct ErrorHandler {
private static var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Account")
public static func present(_ error: Error) {
UIApplication.shared.presentError(error)
public static func present(_ viewController: UIViewController) -> (Error) -> () {
return { [weak viewController] error in
viewController?.presentError(error)
}
}
public static func log(_ error: Error) {
os_log(.error, log: self.log, "%@", error.localizedDescription)
}