Skip to content

Commit

Permalink
chore: AppCoordinator Todo작성
Browse files Browse the repository at this point in the history
  • Loading branch information
JongPyoAhn committed Nov 20, 2023
1 parent 6bd8719 commit dd2511a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import Coordinator
import UIKit

// MARK: - AppCoordinator

final class AppCoordinator: AppCoordinating {
var navigationController: UINavigationController
var childCoordinators: [Coordinating] = []
Expand Down Expand Up @@ -36,3 +38,11 @@ final class AppCoordinator: AppCoordinating {
// (TabBarController 추가되면 로직 추가) (todo)
}
}

// MARK: CoordinatorFinishDelegate

extension AppCoordinator: CoordinatorFinishDelegate {
func flowDidFinished(childCoordinator: Coordinating) {
// TODO: 로그아웃 Flow, 로그인 Flow (앱 실행 도중 발생되는 분기처리)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class TabBarCoordinator: TabBarCoordinating {
let tabBarController = makeTabBarController(tabBarViewControllers: tabBarViewControllers)
navigationController.pushViewController(tabBarController, animated: false)
}

private func makePageNavigationController(page: TabBarPage) -> UINavigationController {
let navigationController = UINavigationController()
let tabBarItem = UITabBarItem(title: page.title, image: page.image, selectedImage: page.selectedImage)
Expand All @@ -42,7 +42,6 @@ final class TabBarCoordinator: TabBarCoordinating {
return navigationController
}


private func startTabBarCoordinator(page: TabBarPage, pageNavigationViewController: UINavigationController) {
switch page {
case .home:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public final class RecordFeatureCoordinator: RecordFeatureCoordinating {
// MARK: CoordinatorFinishDelegate

extension RecordFeatureCoordinator: CoordinatorFinishDelegate {
public func flowDidFinished(childCoordinator _: Coordinating) {}
public func flowDidFinished(childCoordinator: Coordinating) {
childCoordinators = childCoordinators.filter {
$0.flow != childCoordinator.flow
}
navigationController.popToRootViewController(animated: false)
}
}

// MARK: WorkoutSettingCoordinatorFinishDelegate
Expand Down

0 comments on commit dd2511a

Please sign in to comment.