-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/#79 1차 전체 QA 반영 #80
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
Changes from all commits
c66a659
3328ca3
74f12ff
ca0ce12
d87eb9e
0f0a14c
b9e99e0
8cf69db
999457e
df46701
47103f3
84a3e33
a5b3680
b2722a5
0906ef1
0fc3a31
6bd22e1
0a01e08
84366a4
11f7622
8d08ed1
1d95879
35339f3
08164a2
58d5053
4a87b01
40d9995
2e19965
98b879b
5e04e0b
dc3f8d4
d1f9f41
ae20421
fcbcacd
ee2e6a7
124ab75
da51eaf
7de7d05
26dcbb5
1c7db0f
50ccfcb
501f9e5
b156dd3
0539e65
6309ddc
bda2d74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,28 @@ final class BottomNavigationViewController: UITabBarController { | |
| self.selectedIndex = item.rawValue | ||
| } | ||
|
|
||
| func handleScenarioTap(title: String) { | ||
| let homeIndex = BottomNavigationItem.home.rawValue | ||
|
|
||
| guard let viewControllers = self.viewControllers, | ||
| homeIndex < viewControllers.count else { | ||
| return | ||
| } | ||
|
|
||
| var homeVC = viewControllers[homeIndex] | ||
|
|
||
| if let navController = homeVC as? UINavigationController, | ||
| let rootVC = navController.viewControllers.first { | ||
| homeVC = rootVC | ||
| } | ||
|
|
||
| guard let finalHomeVC = homeVC as? HomeViewController else { | ||
| return | ||
| } | ||
|
|
||
| finalHomeVC.handleScenarioTap(title: title) | ||
| } | ||
|
|
||
| private func setViewControllers() { | ||
| self.viewControllers = BottomNavigationItem.allCases.map { | ||
| createViewController( | ||
|
|
@@ -46,12 +68,14 @@ final class BottomNavigationViewController: UITabBarController { | |
| title: String, | ||
| image: UIImage | ||
| ) -> UIViewController { | ||
| let viewController = UINavigationController(rootViewController: rootViewController) | ||
| rootViewController.tabBarItem.do{ | ||
| rootViewController.tabBarItem.do { | ||
| $0.title = title | ||
| $0.image = image.withRenderingMode(.alwaysTemplate) | ||
| } | ||
| return viewController | ||
| if let viewController = rootViewController as? HomeViewController { | ||
| return viewController | ||
| } | ||
| return UINavigationController(rootViewController: rootViewController) | ||
|
Comment on lines
+75
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
| private func createTabBarAppearance() -> UITabBarAppearance { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // | ||
| // ToastMessageType.swift | ||
| // BeforeGoing | ||
| // | ||
| // Created by APPLE on 11/2/25. | ||
| // | ||
|
|
||
| import UIKit | ||
|
|
||
| enum ToastMessageType { | ||
|
|
||
| case todayMissionLimit | ||
| case missionLimit | ||
| case duplicateMission | ||
|
|
||
| var image: UIImage { | ||
| return .errorToast | ||
| } | ||
|
|
||
| var message: String { | ||
| switch self { | ||
| case .todayMissionLimit: | ||
| return "오늘의 미션은 20개까지만 설정할 수 있어요" | ||
| case .missionLimit: | ||
| return "미션은 20개까지만 설정할 수 있어요" | ||
| case .duplicateMission: | ||
| return "중복된 이름의 미션은 설정할 수 없어요" | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tooManyRequset에 오타가 있습니다.tooManyRequest로 수정하는 것이 좋겠습니다. 이 오타는NetworkService.swift와 새로 추가된NetworkRequestErrorHandler.swift에서도 사용되고 있어, 정의 부분을 수정하면 관련된 모든 코드의 가독성과 유지보수성이 향상될 것입니다.