Skip to content
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

Solve retain cycle #1

Merged
merged 1 commit into from
Jul 19, 2019
Merged

Solve retain cycle #1

merged 1 commit into from
Jul 19, 2019

Conversation

kevinrenskers
Copy link
Contributor

See https://stackoverflow.com/questions/57112264/weird-retain-cycle-when-using-the-coordinator-pattern for a description of the problem that causes the retain cycle.

@kevinrenskers
Copy link
Contributor Author

Maybe it would be better to use the runCompletion(for controller: UIViewController) method since that's already taking care of cleaning up the completions dictionary, but this was the simplest one-line solution to my problem :)

@daveneff
Copy link
Owner

Good catch! I agree, I think trying to use runCompletion(for controller: UIViewController) makes less sense given that this completely resets the root and we'd have to manually capture the existing view controller hierarchy and run that function on each view controller. I like your simple solution :)

Thanks so much for the contribution!

@daveneff daveneff merged commit fe87295 into daveneff:master Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants