From 5f38de3b5edb0db5cea27bbdbffc5f101d2d723a Mon Sep 17 00:00:00 2001 From: Erik Drobne Date: Sun, 24 Mar 2024 11:58:29 +0100 Subject: [PATCH] feature(swift 6 concurrency): Make NavigationControllerFactory conform to Sendable. --- .../NavigationController/NavigationControllerFactory.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftUICoordinator/Routing/NavigationController/NavigationControllerFactory.swift b/Sources/SwiftUICoordinator/Routing/NavigationController/NavigationControllerFactory.swift index 2f6670e..e005a0b 100644 --- a/Sources/SwiftUICoordinator/Routing/NavigationController/NavigationControllerFactory.swift +++ b/Sources/SwiftUICoordinator/Routing/NavigationController/NavigationControllerFactory.swift @@ -7,7 +7,6 @@ import Foundation -@MainActor protocol NavigationControllerCreatable { func makeNavigationDelegate(_ transitions: [Transitionable]) -> NavigationControllerDelegateProxy func makeNavigationController( @@ -17,16 +16,18 @@ protocol NavigationControllerCreatable { } /// A factory class for creating navigation controllers and their delegates. -public final class NavigationControllerFactory: NavigationControllerCreatable { +public final class NavigationControllerFactory: NavigationControllerCreatable, Sendable { public init() {} + @MainActor public func makeNavigationDelegate(_ transitions: [Transitionable]) -> NavigationControllerDelegateProxy { let transitionProvider = TransitionProvider(transitions: transitions) let transitionHandler = NavigationControllerTransitionHandler(provider: transitionProvider) return NavigationControllerDelegateProxy(transitionHandler: transitionHandler) } + @MainActor public func makeNavigationController( isNavigationBarHidden: Bool = true, delegate: NavigationControllerDelegateProxy? = nil