Skip to content

Commit b5fe2f1

Browse files
committed
Make navigation vc weak inside flow
1 parent 45cac1b commit b5fe2f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ExampleMVVM/Presentation/MoviesScene/Flows/MoviesSearchFlowCoordinator.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protocol MoviesSearchFlowCoordinatorDependencies {
1515

1616
class MoviesSearchFlowCoordinator {
1717

18-
private let navigationController: UINavigationController
18+
private weak var navigationController: UINavigationController?
1919
private let dependencies: MoviesSearchFlowCoordinatorDependencies
2020

2121
private weak var moviesListVC: MoviesListViewController?
@@ -34,13 +34,13 @@ class MoviesSearchFlowCoordinator {
3434
closeMovieQueriesSuggestions: closeMovieQueriesSuggestions)
3535
let vc = dependencies.makeMoviesListViewController(closures: closures)
3636

37-
navigationController.pushViewController(vc, animated: false)
37+
navigationController?.pushViewController(vc, animated: false)
3838
moviesListVC = vc
3939
}
4040

4141
private func showMovieDetails(movie: Movie) {
4242
let vc = dependencies.makeMoviesDetailsViewController(movie: movie)
43-
navigationController.pushViewController(vc, animated: true)
43+
navigationController?.pushViewController(vc, animated: true)
4444
}
4545

4646
private func showMovieQueriesSuggestions(didSelect: @escaping (MovieQuery) -> Void) {

0 commit comments

Comments
 (0)