Closed berkakkerman closed 3 years ago
@berkakkerman any solution to this ?
@mathemandy Unfortunately, not yet :(
Hey,
each coordinator has a rootViewController (e.g. a UINavigationController
in the case of a NavigationCoordinator
), which it holds strongly. To make sure, that each coordinator is cleaned
, you will have to trigger a route on the AuthCoordinator
that is removing the existing state - or: can you simply create a new instance instead?
@pauljohanneskraft Thank you. It works like a charm right now.
I am trying to implemented an app with sign in and sign out flow. Firstly, I have main coordinator(AppCoordinator) like below. AppCoordinator routes to AuthCoordinator first and AuthCoordinator has 3 views;
After a successful sign in, App routes to HomeCoordinator with a publish subject subscription. HomeCoordinator is like TabBarCoordinator. In the Profile tab, a sign out button action is available.
HomeRoute
After logout
Although I did
.dismissAll()
first, the old AuthCoordinator is opening. AuthCoordinator keeps its state. How can I re-create the AuthCoordinator and start it again from a new AuthCoordinator. This issue is happening for the HomeCoordinator.AppCoordinator is created by a function from AppDelegate.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { setupCoordinator() return true }
AppCoordinator is instantiating with Swinject here.
private func setupCoordinator() { self.appCoordinator = appAssembler.resolver.resolve(AppCoordinator.self)! let router = self.appCoordinator.strongRouter router.setRoot(for: mainWindow) }
AppCoordinator with 3 routes.