Skip to content

Commit

Permalink
Merge pull request #1002 from DeluxeAlonso/feature/code-cleanup
Browse files Browse the repository at this point in the history
Feature/code cleanup
  • Loading branch information
DeluxeAlonso authored Oct 26, 2024
2 parents ad593c4 + d92158c commit 787f9e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ final class NavigationHandler: NavigationHandlerProtocol {
changeTabBarToSelectedIndex(RootCoordinatorIdentifier.account, from: window)
// TODO: - Refactor
let rootCoordinator = rootCoordinators[index(for: RootCoordinatorIdentifier.account)]
let unwrappedParentCoordinator = rootCoordinator.childCoordinators.last?.unwrappedParentCoordinator
let coordinator = FavoritesSavedMoviesCoordinator(navigationController: unwrappedParentCoordinator?.navigationController ?? UINavigationController())
let unwrappedParentCoordinator = rootCoordinator.childCoordinators.last?.unwrappedParentCoordinator ?? rootCoordinator
let coordinator = FavoritesSavedMoviesCoordinator(navigationController: unwrappedParentCoordinator.navigationController)
coordinator.parentCoordinator = unwrappedParentCoordinator
unwrappedParentCoordinator?.childCoordinators.append(coordinator)
unwrappedParentCoordinator.childCoordinators.append(coordinator)
coordinator.start()
}
}
Expand Down
5 changes: 2 additions & 3 deletions UpcomingMovies/Scenes/Account/AccountCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ final class AccountCoordinator: BaseCoordinator, AccountCoordinatorProtocol {
private var profileCoordinator: ProfileCoordinator?
private var signInCoordinator: SignInCoordinator?

override func start() {
override func build() -> AccountViewController {
let viewController = AccountViewController.instantiate()

viewController.viewModel = DIContainer.shared.resolve()
viewController.coordinator = self

navigationController.pushViewController(viewController, animated: true)
return viewController
}

func embedSignInViewController(on parentViewController: SignInViewControllerDelegate) {
Expand Down
2 changes: 1 addition & 1 deletion UpcomingMovies/Scenes/TabBar/MainTabBarBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class MainTabBarBuilder {

let accountNavigationController = createNavigationController(title: LocalizedStrings.accountTabBarTitle(), image: #imageLiteral(resourceName: "Account"))
let accountCoordinator = AccountCoordinator(navigationController: accountNavigationController)
accountCoordinator.start()
accountCoordinator.start(coordinatorMode: .push)

return [
upcomingMoviesCoordinator,
Expand Down

0 comments on commit 787f9e3

Please sign in to comment.