From 09cf212057fbfb94b9a58afa83c630c9f7c950d8 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 3 May 2024 22:32:48 -0700 Subject: [PATCH] Fix some concurrency warnings. --- iOS/ErrorHandler.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iOS/ErrorHandler.swift b/iOS/ErrorHandler.swift index 94d4fae36..5b6da08c3 100644 --- a/iOS/ErrorHandler.swift +++ b/iOS/ErrorHandler.swift @@ -11,9 +11,10 @@ import os.log struct ErrorHandler { - private static var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Application") + nonisolated(unsafe) private static let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Application") - public static func present(_ viewController: UIViewController) -> (Error) -> () { + public static func present(_ viewController: UIViewController) -> @MainActor (Error) -> () { + return { @MainActor [weak viewController] error in if UIApplication.shared.applicationState == .active { viewController?.presentError(error)