diff options
| author | Bug Magnet <marco.nikic@mullvad.net> | 2025-01-14 11:49:21 +0100 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2025-01-14 11:49:21 +0100 |
| commit | ed0b9cd0283e26e216fbb7edf5cd6e5bcf042cde (patch) | |
| tree | 6fc5be4a68ffde2337d1bc3bb516ff46144a07be /ios/RoutingTests/RouterBlockDelegate.swift | |
| parent | d2949b4a0b1d3d86a25de1569dc8308c9d7fe237 (diff) | |
| parent | e71db0cfc12bd561532b73722983175edab2482c (diff) | |
| download | mullvadvpn-ed0b9cd0283e26e216fbb7edf5cd6e5bcf042cde.tar.xz mullvadvpn-ed0b9cd0283e26e216fbb7edf5cd6e5bcf042cde.zip | |
Merge branch 'fix-warnings-introduced-by-xcode-16-ios-741'
Diffstat (limited to 'ios/RoutingTests/RouterBlockDelegate.swift')
| -rw-r--r-- | ios/RoutingTests/RouterBlockDelegate.swift | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ios/RoutingTests/RouterBlockDelegate.swift b/ios/RoutingTests/RouterBlockDelegate.swift index 977454b7e4..07204d5fa9 100644 --- a/ios/RoutingTests/RouterBlockDelegate.swift +++ b/ios/RoutingTests/RouterBlockDelegate.swift @@ -9,26 +9,28 @@ import Foundation import Routing -class RouterBlockDelegate<RouteType: AppRouteProtocol>: ApplicationRouterDelegate { +final class RouterBlockDelegate<RouteType: AppRouteProtocol>: ApplicationRouterDelegate, @unchecked Sendable { var handleRoute: ((RoutePresentationContext<RouteType>, Bool, (Coordinator) -> Void) -> Void)? var handleDismiss: ((RouteDismissalContext<RouteType>, () -> Void) -> Void)? var shouldPresent: ((RouteType) -> Bool)? var shouldDismiss: ((RouteDismissalContext<RouteType>) -> Bool)? - var handleSubnavigation: ((RouteSubnavigationContext<RouteType>, () -> Void) -> Void)? + var handleSubnavigation: (@Sendable @MainActor (RouteSubnavigationContext<RouteType>, () -> Void) -> Void)? - func applicationRouter( + nonisolated func applicationRouter( _ router: ApplicationRouter<RouteType>, presentWithContext context: RoutePresentationContext<RouteType>, animated: Bool, - completion: @escaping (Coordinator) -> Void + completion: @escaping @Sendable (Coordinator) -> Void ) { - handleRoute?(context, animated, completion) ?? completion(Coordinator()) + MainActor.assumeIsolated { + handleRoute?(context, animated, completion) ?? completion(Coordinator()) + } } func applicationRouter( _ router: ApplicationRouter<RouteType>, dismissWithContext context: RouteDismissalContext<RouteType>, - completion: @escaping () -> Void + completion: @escaping @Sendable () -> Void ) { handleDismiss?(context, completion) ?? completion() } @@ -47,8 +49,10 @@ class RouterBlockDelegate<RouteType: AppRouteProtocol>: ApplicationRouterDelegat func applicationRouter( _ router: ApplicationRouter<RouteType>, handleSubNavigationWithContext context: RouteSubnavigationContext<RouteType>, - completion: @escaping () -> Void + completion: @escaping @Sendable @MainActor () -> Void ) { - handleSubnavigation?(context, completion) ?? completion() + MainActor.assumeIsolated { + handleSubnavigation?(context, completion) ?? completion() + } } } |
