Skip to content

Commit

Permalink
Merge pull request #22 from boostcampwm-2022/refactor/Coordinators
Browse files Browse the repository at this point in the history
TabBarPage 메서드 수정
  • Loading branch information
jinwoong16 committed Nov 17, 2022
2 parents e9601dc + 8a5275d commit 6526158
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions DailyQuest/DailyQuest/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class AppCoordinator: NSObject, TabCoordinator, UITabBarControllerDelegate
private func prepareTabBarController(withTabControllers tabControllers: [UIViewController]) {
tabBarController.delegate = self
tabBarController.setViewControllers(tabControllers, animated: true)
tabBarController.selectedIndex = TabBarPage.home.pageOrderNumber()
tabBarController.selectedIndex = TabBarPage.home.pageOrderNumber
tabBarController.tabBar.isTranslucent = false

}
Expand All @@ -38,9 +38,9 @@ final class AppCoordinator: NSObject, TabCoordinator, UITabBarControllerDelegate
let navController = UINavigationController()
navController.setNavigationBarHidden(false, animated: false)

navController.tabBarItem = UITabBarItem.init(title: page.pageTitleValue(),
image: page.pageIcon(),
tag: page.pageOrderNumber())
navController.tabBarItem = UITabBarItem.init(title: page.pageTitleValue,
image: page.pageIcon,
tag: page.pageOrderNumber)

switch page {
case .home:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum TabBarPage {
}
}

func pageTitleValue() -> String {
var pageTitleValue: String {
switch self {
case .home:
return ""
Expand All @@ -40,7 +40,7 @@ enum TabBarPage {
}
}

func pageOrderNumber() -> Int {
var pageOrderNumber: Int {
switch self {
case .home:
return 0
Expand All @@ -51,7 +51,7 @@ enum TabBarPage {
}
}

func pageIcon() -> UIImage? {
var pageIcon: UIImage? {
switch self {
case .home:
return UIImage(systemName: "house")
Expand Down

0 comments on commit 6526158

Please sign in to comment.