-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Child Coordinator is deallocated if presented too quickly #208
Comments
chefnobody
changed the title
Child Coordinator is deallocated if presented _too quickly_
Child Coordinator is deallocated if presented too quickly
May 27, 2021
@chefnobody I am facing the same issue, did you find anyway to avoid it rather than adding a manual delay? |
The only think that worked for me was to manually manage the coordinator reference. var fooCoordinator: FooCoordinator?
func showFoo() -> NavigationTransition {
let coordinator = FooCoordinator()
fooCoordinator = coordinator // and latter fooCoordinator = nil
return .present(coordinator)
} |
@ericklborges it's been a long time since I looked at this and no, I didn't solve it w/o the delay. Also, I just stopped using this lib as its not really being maintained. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Presenting a child coordinator too quickly sometimes results in the Coordinator getting deallocated. Find the attached sample project as proof.
https://github.com/chefnobody/DeallocSample
In the attached project, you will find
NavigationCoordinator
s that trigger some action after 1.0 second:RootCoordinator
pushesListCoordinator
, which presentsProfileCoordinator
, which presentsOnboardingCoordinator
.Line ~73 of AppDelegate reads like this:
Run the code as-is should result in a log like this:
Changing the dispatch delay time on line 73 to
1.0
:Does not cause ProfileCoordinator to deallocate and successfully presents the final
OnboardingCoordinator
The text was updated successfully, but these errors were encountered: