-
Notifications
You must be signed in to change notification settings - Fork 17
[Refactor] #761 - deeplink refactor #772
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
base: develop
Are you sure you want to change the base?
Conversation
Summary by CodeRabbit๋ฆด๋ฆฌ์ค ๋ ธํธ
โ๏ธ Tip: You can customize this high-level summary in your review settings. WalkthroughTabBar ์ด๊ธฐ ์ ํ ์ธ์๊ฐ ๋์ ๋์ด ๋ฅ๋งํฌ๋ค์ด ๋ชฉ์ ์ง์ผ ๋ ํด๋น ํญ์ผ๋ก ์ง์ ๋ผ์ฐํ ํ๋๋ก ๋ณ๊ฒฝ๋์๊ณ , TabBarItemType์ ํญ ์ธ๋ฑ์ค ํฌํผ์ soptamp ์ผ์ด์ค๋ช ์ด ์ถ๊ฐ/์์ ๋์์ต๋๋ค. Changes
Sequence Diagram(s)sequenceDiagram
participant DeepLink as DeepLinkExecutor
participant AppCoord as ApplicationCoordinator
participant TabCoord as TabBarCoordinator
participant TabBar as UITabBarController
DeepLink->>AppCoord: execute(isDestination: true, target: <tab>)
AppCoord->>TabCoord: runTabBarFlow(initSelectedTabType: TabBarItemType.<tab>)
TabCoord->>TabBar: start() (reuse existing?)
alt existing TabBarController found
TabCoord->>TabBar: set selectedIndex = selectedTabType.getTabIndex(userType)
else create new TabBarController
TabCoord->>TabBar: showTabBar() -> configure items
TabCoord->>TabBar: set selectedIndex = selectedTabType.getTabIndex(userType)
end
TabBar-->>AppCoord: presented
AppCoord-->>DeepLink: return coordinator
Estimated code review effort๐ฏ 3 (Moderate) | โฑ๏ธ ~20 minutes ๊ฒํ ์ ์ฃผ์ ์ฌํญ:
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touchesโ Failed checks (2 warnings)
โ Passed checks (3 passed)
โจ Finishing touches
๐งช Generate unit tests (beta)
๐ Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ๐ Files selected for processing (2)
๐งฐ Additional context used๐ง Learnings (2)๐ Learning: 2025-09-23T04:48:57.229ZApplied to files:
๐ Learning: 2025-12-07T07:54:51.207ZApplied to files:
๐งฌ Code graph analysis (1)SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift (2)
๐ Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
๐งน Nitpick comments (4)
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptlogDeepLink.swift (1)
21-23:soptlog๋ฃจํธ ๋ฅ๋งํฌ์์ ํญ์ ์ ํญ๋ฐ ํ๋ก์ฐ๋ฅผ ํ๋ ๋์ ํ์ธ ํ์
isDestination == true์ธ ๊ฒฝ์ฐ์๋งrunTabBarFlow(initSelectedTabType: .soptlog)๋ฅผ ํธ์ถํด์ ํญ๋ฐ๋ฅผ ๋์ฐ๊ณ , ๋ ๊ฑฐ์ ํ๋๊ทธ(Config.coordinatorFlag)๋ ๋ ์ด์ ๊ณ ๋ คํ์ง ์๋ ๊ตฌ์กฐ์ ๋๋ค.
๋ฅ๋งํฌ๊ฐ ๋ ๊ฑฐ์ ๋ชจ๋์์๋ ํญ์ ์ ํญ๋ฐ ํ๋ก์ฐ๋ฅผ ํ๋๋ก ์๋ํ์ ๊ฒ์ธ์ง ํ ๋ฒ๋ง ๋ ํ์ธํด ์ฃผ์ธ์. ์๋๋ ๊ฒ์ด๋ผ๋ฉด ๊ตฌํ ์์ฒด๋ ๊น๋ํฉ๋๋ค.SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/PokeDeepLink.swift (1)
17-26: ๋ฃจํธ vs ํ์poke๋ฅ๋งํฌ ๋ถ๊ธฐ ์ค๊ณ๋ ์์ฐ์ค๋ฝ์ง๋ง, ๋ ๊ฑฐ์ ๋ชจ๋ ์๋๋ฆฌ์ค๋ง ํ๋ฒ ์ ๊ฒ ๊ถ์ฅ
- ๋ฃจํธ ๊ฒฝ๋ก(
"poke")์ธ ๊ฒฝ์ฐrunTabBarFlow(initSelectedTabType: .poke)๋ฅผ ํตํด ํญ๋ฐ์ Poke ํญ์ ์ ํํ๊ณApplicationCoordinator๋ฅผ ๊ทธ๋๋ก ๋ฐํ.- ํ์ ๊ฒฝ๋ก(
"poke/...)์์๋ ๊ธฐ์กด์ฒ๋ผrunPokeFlow()๊ฒฐ๊ณผ๋ฅผPokeCoordinator๋ก ์บ์คํ ํด ๋ค์ ๋ฅ๋งํฌ๋ก ๋๊ธฐ๋ ๊ตฌ์กฐ์ ๋๋ค.๋ฅ๋งํฌ๋ฅผ ํตํด ํญ๋ฐ ๋ด Poke ํญ์ผ๋ก๋ง ์ด๋ํ๊ณ ์ถ์ ๋์, ๋ ๋ฆฝ Poke ํ๋ก์ฐ๋ฅผ ํ์ผ ํ ๋๊ฐ ์ ๋ถ๋ฆฌ๋์ด ์์ด ์ค๊ณ๋ ์ข์ ๋ณด์ ๋๋ค.
๋ค๋ง ์ด ๋ณ๊ฒฝ์ผ๋ก ๋ ๊ฑฐ์ ๋ชจ๋์์๋ ๋ฃจํธpoke๋ฅ๋งํฌ๊ฐ ํญ์ ์ ํญ๋ฐ ํ๋ก์ฐ๋ฅผ ํ๊ฒ ๋๋ฏ๋ก, ๋ ๊ฑฐ์ ๋์์ ๋ ์ด์ ์ง์ํ์ง ์์๋ ๋๋์ง(๋๋ ์ ํ ์ ๋ต์ด ์ด๋ฏธ ํฉ์๋์๋์ง)๋ง ํ ๋ฒ ํ์ธํด ๋ณด์๋ฉด ์ข๊ฒ ์ต๋๋ค.SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptampDeepLink.swift (1)
17-26:soptamp๋ฃจํธ ๋ฅ๋งํฌ์ ๋นํ์/๋นํ์ฑ ์ ์ ๋์ ์๋ ํ์ธ๋ฃจํธ
"soptamp"์ผ ๋๋runTabBarFlow(initSelectedTabType: .soptstamp)๋ฅผ ํ๊ณ , ๊ทธ ์์์TabBarCoordinator.getTabIndex๊ฐuserType์ ๋ฐ๋ผ ์ธ๋ฑ์ค๋ฅผ ๋งคํํฉ๋๋ค.
userType == .activeโ.soptstamp๊ฐ ์ธ๋ฑ์ค 1(Stamp ํญ)์ผ๋ก ๋งคํ๋์ด ๊ธฐ๋๋๋ก Stamp ํญ์ผ๋ก ์ง์ .userType == .visitor/.inactiveโ.soptstamp๊ฐ ์ธ๋ฑ์ค 0 ์ผ๋ก ๋งคํ๋์ด ๊ฒฐ๊ณผ์ ์ผ๋ก ํ ํญ์ผ๋ก ๋จ์ด์ง๋๋ค.๋นํ์/๋นํ์ฑ ์ ์ ๊ฐ
/soptamp๋ฃจํธ ๋ฅ๋งํฌ๋ฅผ ํ์ ๋ ํ์ผ๋ก ํฌ์๋ฉ๋๋ ๋์์ด ๊ธฐํ/UX ์ ์๋๋ ๊ฒ์ธ์ง ํ ๋ฒ๋ง ๋ ํ์ธํด ๋ณด์๋ฉด ์ข๊ฒ ์ต๋๋ค. (์๋๋ ๊ฒ์ด๋ผ๋ฉด ํ์ฌ ๊ตฌํ์ ์ผ๊ด์ ์ ๋๋ค.)SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift (1)
34-35: ์ ํ ํญ ํ์ ๋์ ๊ณผ ๊ธฐ์กด ํญ๋ฐ ์ฌ์ฌ์ฉ ๋ก์ง์ด ์ ์ฒด ํ๋ก์ฐ์ ์ ๋ง์ต๋๋ค (userType ๋ณ๊ฒฝ ์๋๋ฆฌ์ค๋ ์ฃผ์)
selectedTabTypeํ๋กํผํฐ/ํ๋ผ๋ฏธํฐ๋ฅผ ์ถ๊ฐํ๊ณ ๊ธฐ๋ณธ๊ฐ์.home์ผ๋ก ์ก์ ๊ฒ์ ๊ธฐ์กด ํธ์ถ๋ถ์์ ํธํ์ฑ๋ ์ ์งํ๋ฉด์ ๋ฅ๋งํฌ ๋ฑ์์ ์ํ๋ ํญ์ ๋ช ์์ ์ผ๋ก ์ ํํ๊ธฐ์ ์ ์ ํฉ๋๋ค.start()์์navigationController?.viewControllers.first๊ฐ ์ด๋ฏธUITabBarController์ธ ๊ฒฝ์ฐ ์ธ๋ฑ์ค๋ง ๊ฐฑ์ ํ๊ณ , ์๋ ๋๋งshowTabBar()๋ก ์๋ก ์์ฑํ๋ ๊ตฌ์กฐ๋ผ, ๋ฅ๋งํฌ๋ก ์ฌ๋ฌ ๋ฒrunTabBarFlow๋ฅผ ํธ์ถํด๋ ํญ๋ฐ๋ฅผ ๋งค๋ฒ ์๋ก ๋ง๋๋ ๋น์ฉ์ ์ค์ผ ์ ์์ต๋๋ค.getTabIndex(for:)๊ฐ
userType == .active์ธ ๊ฒฝ์ฐ[home, soptstamp, poke, soptlog]์์์ ์ ํํ ์ผ์นํ๋๋ก ์ธ๋ฑ์ค๋ฅผ ๋งคํํ๊ณ ,userType == .visitor/.inactive์ธ ๊ฒฝ์ฐ Stamp ํญ์ด ์๋ค๋ ์ ์ ๋ฐ์ํด.soptstamp๋ฅผ ์ธ๋ฑ์ค 0(home)์ผ๋ก, ๋๋จธ์ง๋[home(0), poke(1), soptlog(2)]๋ก ๋งคํํ๋ ์ ๋ ํฉ๋ฆฌ์ ์ ๋๋ค.๋ค๋ง ๋์ผํ
navigationController์์userType์ด ๋ฐ๋์ด ํญ ๊ตฌ์ฑ ์์ฒด๊ฐ ๋ฌ๋ผ์ง๋ ์๋๋ฆฌ์ค(์: ๋นํ์ ์ํ์์ 3๊ฐ ํญ โ ๋ก๊ทธ์ธ ํ active ์ ์ ๋ก 4๊ฐ ํญ์ผ๋ก ์ ํ)๋ฅผ ๋์ค์ ์ง์ํ๊ฒ ๋๋ค๋ฉด, ํ์ฌ์ โ๊ธฐ์กด TabBarController ๊ฐ ์์ผ๋ฉด ๋ฌด์กฐ๊ฑด ์ฌ์ฌ์ฉโ ๋ก์ง์ด ์๋์ ๋ค๋ฅผ ์ ์์ต๋๋ค.
ํ์ฌ ํ๋ก์ฐ ์ ๊ทธ๋ฐ ์ ํ์ด ์๋ค๋ฉด ์ด ๊ตฌํ์ ์ถฉ๋ถํ ํฉ๋ฆฌ์ ์ด์ง๋ง, userType ์ ํ์ ์ถ๊ฐํ ๊ณํ์ด ์๋์ง ํ ๋ฒ๋ง ์ง๊ณ ๊ฐ๋ฉด ์ข๊ฒ ์ต๋๋ค.Also applies to: 42-44, 49-50, 55-60, 103-105, 109-132
๐ Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
๐ Files selected for processing (7)
SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift(1 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/HomeDeepLink.swift(1 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/PokeDeepLink.swift(1 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptampDeepLink.swift(1 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptlogDeepLink.swift(1 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/NotificationHelpers/Parser/DeepLinkParser.swift(2 hunks)SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift(2 hunks)
๐งฐ Additional context used
๐ง Learnings (1)
๐ Learning: 2025-09-23T04:48:57.229Z
Learnt from: dlwogus0128
Repo: sopt-makers/SOPT-iOS PR: 699
File: SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift:576-581
Timestamp: 2025-09-23T04:48:57.229Z
Learning: In SOPT-iOS coordinator refactoring: Legacy coordinators require addDependency() calls for proper lifecycle management, but the new coordinator architecture handles dependency management differently and does not require explicit addDependency() calls.
Applied to files:
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/PokeDeepLink.swiftSOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptampDeepLink.swiftSOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/HomeDeepLink.swiftSOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptlogDeepLink.swiftSOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swiftSOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift
๐งฌ Code graph analysis (1)
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/HomeDeepLink.swift (1)
SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift (1)
runTabBarFlow(380-418)
๐ Additional comments (3)
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/HomeDeepLink.swift (1)
21-23: ํ ๋ฃจํธ ๋ฅ๋งํฌ์ ํญ ์ ํ ๋์์ด ๋ค๋ฅธ ๋ฅ๋งํฌ๋ค๊ณผ ์ ์ ๋ ฌ๋์ด ์์ต๋๋ค
isDestination == true์ธ"home"๋ฃจํธ์์๋งrunTabBarFlow(initSelectedTabType: .home)๋ฅผ ํธ์ถํ๊ณ , ๊ทธ ์ธ์๋ ์๋ฌด๊ฒ๋ ํ์ง ์๋ ๊ตฌ์กฐ๋ผ์:
- ํญ๋ฐ๊ฐ ์ด๋ฏธ ๋ ์๋ ๊ฒฝ์ฐ์๋ ๋จ์ํ ํ ํญ๋ง ์ ํํ๊ฒ ๋๊ณ ,
TabBarCoordinator.getTabIndex๊ธฐ์ค์ผ๋ก๋ ๋ชจ๋userType์์ ์ธ๋ฑ์ค 0 ์ผ๋ก ์ผ๊ด๋๊ฒ ๋งคํ๋ฉ๋๋ค.๋ค๋ฅธ ๋ฃจํธ ๋ฅ๋งํฌ๋ค(
soptlog,soptamp,poke)๊ณผ ํจํด์ด ์ ๋ง์์ ์ดํดํ๊ธฐ ์ฝ๊ณ ์ ์ง๋ณด์์๋ ์ข์ ๋ณด์ ๋๋ค.SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift (1)
409-415: TabBarCoordinator ๋ก์initSelectedTabType์ ๋ฌ์ด ์์ฐ์ค๋ฝ๊ฒ ์ ์ฐ๊ฒฐ๋์์ต๋๋ค
runTabBarFlow(type:initSelectedTabType:)์์TabBarCoordinator์์ฑ ์userType: userType, selectedTabType: initSelectedTabType๋ฅผ ๋๊ธฐ๋ฉด์, ๊ฐ ๋ฅ๋งํฌ์์ ์ง์ ํ ์ด๊ธฐ ํญ ํ์ ์ด ์ค์ ํญ๋ฐ ์ ํ์ ๋ฐ์๋๋ ๊ฒฝ๋ก๊ฐ ์์ฐ์ค๋ฝ๊ฒ ์์ฑ๋์์ต๋๋ค.
์๊ทธ๋์ฒ ๊ธฐ๋ณธ๊ฐ(.home)๊ณผ๋ ์ถฉ๋ ์์ด ์ ๋ง์ต๋๋ค.SOPT-iOS/Projects/Features/RootFeature/Sources/NotificationHelpers/Parser/DeepLinkParser.swift (1)
15-17: ๋ฃจํธ ๋ฅ๋งํฌ ํ์ฅ ๋ฐ ๊ธฐ๋ณธ ๋ฅ๋งํฌ ๋ฆฌ์คํธ๊ฐ ํญ ๊ตฌ์ฑ์ด๋ ์ ๋ง์ต๋๋ค
defaultDeepLinks๋ฅผ[HomeDeepLink(), SoptampDeepLink(), PokeDeepLink(), SoptlogDeepLink()]๋ก ํ์ฅํ ๋ถ๋ถ์ ํ์ฌ ํญ ๊ตฌ์ฑ(home, soptstamp, poke, soptlog)๊ณผ ์์ฐ์ค๋ฝ๊ฒ ์ ๋ ฌ๋์ด ์์ต๋๋ค.findRootDeepLink์"soptamp","poke"์ผ์ด์ค๋ฅผ ์ถ๊ฐํด์ ๊ฐ DeepLink ์name๊ณผ 1:1 ๋ก ๋์์ํค๋ ๊ฒ๋ ํ์ ์ ์ฅ์์ ๊น๋ํฉ๋๋ค.๋จ, ํ์ฑ ์คํจ ์ ๊ธฐ๋ณธ ๋ฃจํธ ๋ฆฌ์คํธ๋ฅผ ์ฌ์ฉํ๋ ์ชฝ(์: ์๋ชป๋ ๋งํฌ์์ ์ด๋ค ํ๋ฉด์ ๋ณด์ฌ์ค์ง)์ UX ๋ณํ๊ฐ ์๊ธธ ์ ์์ผ๋, ์ค์ ํธ์ถ๋ถ์์ ๊ธฐ๋ํ๋ ๊ธฐ๋ณธ ์ง์ ์ ์ด ์ด ์์์ ์ผ์นํ๋์ง๋ง ํ ๋ฒ ํ์ธํด ๋ณด์๋ฉด ์ข๊ฒ ์ต๋๋ค.
Also applies to: 64-72
hye0njuoo
left a comment
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.
ํ์ธํ์ต๋๋น ์ฝ๋ ๋ ๊น๋ํ๋ค์!!
yungu0010
left a comment
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.
๊ถ๊ธํ ๋ถ๋ถ ์ฝ๋ฉํธ ๋จ๊ฒผ์ต๋๋ค!
| } | ||
|
|
||
| return coordinator | ||
| return coordinator.runPokeFlow() as? PokeCoordinator |
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.
PokeCoordinator๋ฅผ ๋ฐํํด์ผํ๋ ์ด์ ๊ฐ ๋ฌด์์ธ๊ฐ์ ? ? (SoptampCoordinator ๋ถ๋ถ๋ ๋์ผํ๊ฒ ๊ถ๊ธํด์)
| public override func start() { | ||
| showTabBar() | ||
| if let existingTabBar = navigationController?.viewControllers.first as? UITabBarController { | ||
| let tabIndex = getTabIndex(for: selectedTabType) |
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.
showTabBar ๋ฉ์๋ ๋ด์์๋ selectedIndex๋ฅผ ์ง์ ํด์ฃผ๊ณ ์๋๋ฐ ๋ถ๊ธฐ์ฒ๋ฆฌ๋ฅผ ํ์ ์ด์ ๊ฐ ์๋์?
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.
start ๋ฉ์๋๊ฐ ์คํ๋ ๋๋ง๋ค showTabBar()๊ฐ ํธ์ถ๋๋ฉด์ ํญ๋ฐ ์ธ์คํด์ค๋ฅผ ์์ฑํ๊ณ ์์ด์ ํญ๋ฐ๊ฐ ์ด๋ฏธ ์กด์ฌํ๋ ๊ฒฝ์ฐ์๋ index๋ฅผ ๋ฐ๊ฟ์ฃผ๊ณ ์๋ ๊ฒฝ์ฐ์ ํญ๋ฐ ์ธ์คํด์ค๋ฅผ ์์ฑํ๋๋ก ํ๊ธฐ ์ํด ๋ถ๊ธฐ์ฒ๋ฆฌํ์ต๋๋ค!
| self.navigationController?.setViewControllers([tabBar.vc], animated: false) | ||
| } | ||
|
|
||
| private func getTabIndex(for tabType: TabType) -> Int { |
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.
์ด ๋ฉ์๋๋ TabBarItemType.swift๋ก ์ฎ๊ธฐ๋๊ฑฐ ์ด๋ ์ ๊ฐ์? (ํญ๋ฐ ์์ดํ ์ ์์ฑ์ด๋ผ๋ ์๊ฐ์ด ๋ค์ด์์!)
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.
Actionable comments posted: 2
Caution
Some comments are outside the diff and canโt be posted inline due to platform limitations.
โ ๏ธ Outside diff range comments (2)
SOPT-iOS/Projects/Core/Sources/Enum/TabBarItemType.swift (1)
14-26: ํญ ์ธ๋ฑ์ค ์ญ๋งคํ์์ userType์ด ๋ฌด์๋์ด visitor/inactive ์ฌ์ฉ์๊ฐ ์๋ชป๋ ํญ์ผ๋ก ์ด๋ํฉ๋๋ค.
getTabIndex()๋ userType๋ณ๋ก ๋ค๋ฅธ ์ธ๋ฑ์ค ๋งคํ์ ์ ๊ณตํ์ง๋ง, TabBarCoordinator 72์ค์์TabBarItemType(rawValue: index)๋ก ์ญ๋ณํํ ๋ rawValue(์ด๊ฑฐํ ์ ์ธ ์์)๋ง ์ฌ์ฉ๋์ด userType ์ ๋ณด๊ฐ ์์ค๋ฉ๋๋ค.๊ตฌ์ฒด์ ์ผ๋ก, .visitor ๋๋ .inactive ์ฌ์ฉ์์ ๊ฒฝ์ฐ:
getTabIndex()๋ .soptlog์ ๋ํด ์ธ๋ฑ์ค 2๋ฅผ ๋ฐํ- ํ์ง๋ง
TabBarItemType(rawValue: 2)๋ .soptamp๋ฅผ ๋ฐํ (์ด๊ฑฐํ ์์: home=0, poke=1, soptamp=2, soptlog=3)์ด ๋ถ์ผ์น๋ ํญ ์ ํ ์ฒ๋ฆฌ์์ ๋ฒ๊ทธ๋ฅผ ์ ๋ฐํฉ๋๋ค.
์ ์๋
from(index:userType:)ํฌํผ๋ฅผ ์ถ๊ฐํ๊ณ TabBarCoordinator์ rawValue ๊ธฐ๋ฐ ๋ณํ์ ์ด ํฌํผ๋ก ๊ต์ฒดํ๋ฉด userType๋ณ ํญ ์์๋ฅผ ์์ ํ๊ฒ ์ญ๋งคํํ ์ ์์ต๋๋ค:+ static func from(index: Int, userType: UserType) -> TabBarItemType? { + Self.allCases.first { $0.getTabIndex(userType: userType) == index } + }๊ทธ ํ TabBarCoordinator 72์ค์ ๋ค์๊ณผ ๊ฐ์ด ๋ณ๊ฒฝํ์ธ์:
- let tabType = TabBarItemType(rawValue: index) else { return } + let tabType = TabBarItemType.from(index: index, userType: self.userType) else { return }SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift (1)
69-82: Fix tab index mapping to account for user-specific tab orderingThe current code uses
TabBarItemType(rawValue: index)to map tap events, which ignores user type and causes incorrect tab navigation. The enum's rawValue order (home=0, poke=1, soptamp=2, soptlog=3) doesn't match the actual displayed tab order:
- Active users: tabs are [.home, .soptamp, .poke, .soptlog], so index 1 should map to
.soptamp, not.poke(rawValue 1)- Visitor/Inactive: tabs are [.home, .poke, .soptlog], so index 1 should map to
.poke, not the non-existent.soptampSince
getTabIndex(userType:)already defines the correct mappings for selecting tabs initially (lines 104-105), the tap handler should use the inverse mapping to resolve indices consistently:tabBar.vm.onTabBarItemTapped = { [weak self] index in // ๊ฐ ํญ์ ์ฝ๋๋ค์ดํฐ ์คํ guard let self = self, let tabType = TabBarItemType.from(index: index, userType: self.userType) else { return } switch tabType { case .home: self.delegate?.tabBarCoordinator(self, to: .home) case .poke: self.delegate?.tabBarCoordinator(self, to: .poke) case .soptamp: self.delegate?.tabBarCoordinator(self, to: .soptamp) case .soptlog: self.delegate?.tabBarCoordinator(self, to: .soptlog) } }Add a
from(index:userType:)helper toTabBarItemTypethat reverses thegetTabIndexlogic, ensuring both initial selection and tap handling use the same internal mapping.
๐งน Nitpick comments (2)
SOPT-iOS/Projects/Features/TabBarFeature/Sources/Controller/TabBarController.swift (1)
138-146: ํญ ๋ฐฐ์ด๊ณผgetTabIndex๋งคํ์ด ๊ฐํ๊ฒ ๊ฒฐํฉ๋์ด ์์ด, ๋ณ๊ฒฝ ์ ๋๊ธฐํ ์ฃผ์๊ฐ ํ์ํฉ๋๋ค.ํ์ฌ ๊ตฌ์ฑ์ ๋ค์์ฒ๋ผ ์ ๋ง์ต๋๋ค.
- active:
tabs = [.home, .soptamp, .poke, .soptlog]TabBarItemType.getTabIndex(.active): homeโ0, soptampโ1, pokeโ2, soptlogโ3๋ค๋ง ํญ ์์๊ฐ ์ด๊ณณ๊ณผ
TabBarItemType.getTabIndex(userType:)๋ ๊ณณ์ ์ค๋ณต ์ ์๋์ด ์์ด, ๋์ค์ ํญ์ ์ถ๊ฐ/์์ ๋ณ๊ฒฝํ ๋ ๋ ๋ค ๊ฐ์ด ์์ ํด์ผ ํฉ๋๋ค.
์ถ๊ฐ๋ก ์์ ์ฑ์ ๋์ด๋ ค๋ฉด:
TabBarItemType์ชฝ์static func tabs(for userType: UserType) -> [TabBarItemType]๊ฐ์ ํฌํผ๋ฅผ ๋๊ณ ,- ์ฌ๊ธฐ์๋ ๊ทธ ํฌํผ๋ฅผ ์ฌ์ฉํด
tabs๋ฅผ ๊ตฌ์ฑํ๋ ๋ฐฉํฅ๋ ๊ณ ๋ คํด๋ณด์ ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift (1)
376-405: active ์ ์ ์์runStampTabFlow()๊ฐ ๋ ๋ฒ ํธ์ถ๋ฉ๋๋ค.
runTabBarFlow์์์:runHomeFlow(type: userType) runStampTabFlow() runPokeTabFlow() runSoptlogFlow(type: userType) switch userType { case .active: runStampTabFlow() viewControllers = [ homeNavigationController, stampNavigationController, pokeNavigationController, soptlogNavigationController ] ...
.active์ธ ๊ฒฝ์ฐrunStampTabFlow()๊ฐ ์ฐ์์ผ๋ก ๋ ๋ฒ ํธ์ถ๋๋๋ฐ,StampCoordinator.start(isRouteFromTabBar:)๊ตฌํ์ ๋ฐ๋ผ ๋์ผ ํ๋ฉด์ด ๋ ๋ฒ ์์ด๊ฑฐ๋, ๋ถํ์ํ ์ด๊ธฐํ๊ฐ ๋ ๋ฒ ์ผ์ด๋ ์ ์์ต๋๋ค.- ์๋๋ ๊ฒ์ด ์๋๋ผ๋ฉด, ์๋์ฒ๋ผ ์๋จ์ ํ ๋ฒ๋ง ๋จ๊ธฐ๊ฑฐ๋, switch ์์ ํธ์ถ๋ง ๋จ๊ธฐ๋ ์์ผ๋ก ์ ๋ฆฌํ๋ ๊ฒ ์์ ํด ๋ณด์ ๋๋ค.
- runHomeFlow(type: userType) - runStampTabFlow() - runPokeTabFlow() - runSoptlogFlow(type: userType) + runHomeFlow(type: userType) + runStampTabFlow() + runPokeTabFlow() + runSoptlogFlow(type: userType) switch userType { case .active: - runStampTabFlow() viewControllers = [ homeNavigationController, stampNavigationController, pokeNavigationController, soptlogNavigationController ](์ด๋ ์ชฝ์ด ์๋์ธ์ง ํ ์ปจํ ์คํธ์ ๋ฐ๋ผ ์ ํํด์ฃผ์๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค.)
๐ Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
๐ Files selected for processing (9)
SOPT-iOS/Projects/Core/Sources/Enum/TabBarItemType.swift(2 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator+Delegate.swift(2 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift(2 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/PokeDeepLink.swift(1 hunks)SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptampDeepLink.swift(1 hunks)SOPT-iOS/Projects/Features/TabBarFeature/Interface/Sources/TabType.swift(0 hunks)SOPT-iOS/Projects/Features/TabBarFeature/Sources/Components/TabBarItem.swift(2 hunks)SOPT-iOS/Projects/Features/TabBarFeature/Sources/Controller/TabBarController.swift(1 hunks)SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift(3 hunks)
๐ค Files with no reviewable changes (1)
- SOPT-iOS/Projects/Features/TabBarFeature/Interface/Sources/TabType.swift
๐งฐ Additional context used
๐ง Learnings (2)
๐ Learning: 2025-12-07T07:54:51.207Z
Learnt from: yungu0010
Repo: sopt-makers/SOPT-iOS PR: 769
File: SOPT-iOS/Projects/Features/SoptlogFeature/Sources/SoptlogScene/VC/SoptlogVC.swift:27-27
Timestamp: 2025-12-07T07:54:51.207Z
Learning: In SoptlogVC.swift, the isPokeEmpty field is intentionally hardcoded to true and not bound to the ViewModel because it's a temporary measure until the poke server 500 error is fixed. Once the server is stabilized, this field and the empty view implementation will be removed.
Applied to files:
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/PokeDeepLink.swift
๐ Learning: 2025-09-23T04:48:57.229Z
Learnt from: dlwogus0128
Repo: sopt-makers/SOPT-iOS PR: 699
File: SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift:576-581
Timestamp: 2025-09-23T04:48:57.229Z
Learning: In SOPT-iOS coordinator refactoring: Legacy coordinators require addDependency() calls for proper lifecycle management, but the new coordinator architecture handles dependency management differently and does not require explicit addDependency() calls.
Applied to files:
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptampDeepLink.swiftSOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swiftSOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator+Delegate.swiftSOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift
๐งฌ Code graph analysis (2)
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptampDeepLink.swift (4)
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/PokeDeepLink.swift (1)
execute(18-27)SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/HomeDeepLink.swift (1)
execute(18-26)SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptlogDeepLink.swift (1)
execute(18-26)SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift (1)
runTabBarFlow(377-418)
SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift (1)
SOPT-iOS/Projects/Core/Sources/Enum/TabBarItemType.swift (1)
getTabIndex(29-52)
๐ Additional comments (3)
SOPT-iOS/Projects/Features/TabBarFeature/Sources/Components/TabBarItem.swift (1)
15-40: ํญ ์์ดํ ์ด๋ฏธ์ง/ํ์ดํ ๋ฆฌ๋ค์ด๋ฐ ์ผ๊ด์ฑ ์ข์ต๋๋ค.
.soptamp์ผ์ด์ค๋ก ์ด๋ฏธ์ง์ ํ์ดํ ๋ชจ๋ ์ ๋ง์ถฐ์ ธ ์์ด์ TabBarItemType ๋ณ๊ฒฝ๊ณผ ์ผ๊ด์ฑ์ด ์์ต๋๋ค. ์ถ๊ฐ ์ด์๋ ์์ด ๋ณด์ ๋๋ค.SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptampDeepLink.swift (1)
18-27:isDestination๋ถ๊ธฐ์ ํญ๋ฐ/์คํฌํ ํ๋ก์ฐ ๋ถ๋ฆฌ๊ฐ ๋ช ํํฉ๋๋ค.
- ๋ฅ๋งํฌ๊ฐ ์ต์ข ๋ชฉ์ ์ง์ธ ๊ฒฝ์ฐ:
runTabBarFlow(initSelectedTabType: .soptamp)๋ก ํญ๋ฐ๋ง ๋์ฐ๊ณApplicationCoordinator๋ฅผ ๋ฐํ.- ๋ชฉ์ ์ง๊ฐ ์๋ ๊ฒฝ์ฐ: ๊ธฐ์กด์ฒ๋ผ
runStampFlow()๋ก ์คํฌํ ํ๋ก์ฐ ์ง์ .๋ค๋ฅธ ๋ฅ๋งํฌ(Home/Poke/Soptlog)์ ํจํด์ด ์ ๋ง์์ ์ถํ ์ ์ง๋ณด์๋ ์ฉ์ดํด ๋ณด์ ๋๋ค.
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/PokeDeepLink.swift (1)
18-27: Poke ๋ฅ๋งํฌ์ ํญ๋ฐ ์ง์ /ํ๋ก์ฐ ์ง์ ๋ถ๋ฆฌ๊ฐ ์ ์ ๋ฆฌ๋์์ต๋๋ค.
isDestination์ ๋ฐ๋ผ:
- ์ต์ข ๋ชฉ์ ์ง์ผ ๋๋ ํญ๋ฐ์์
.pokeํญ๋ง ์ ํํ๊ณ ,- ์๋ ๋๋ ๊ธฐ์กด
runPokeFlow()๋ก ๊ทธ๋๋ก ์ง์ ํ๋ ๊ตฌ์กฐ๋ผ, ๋ค๋ฅธ ๋ฅ๋งํฌ๋ค๊ณผ ์ผ๊ด๋๊ณ ์ดํดํ๊ธฐ ์ฝ์ต๋๋ค.
| private func selectedTab(_ tab: TabBarItemType) { | ||
| self.tabBarController?.selectedIndex = tab.rawValue | ||
| } |
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.
๐งฉ Analysis chain
๐ Script executed:
find . -type f -name "*.swift" | grep -E "(TabBar|ApplicationCoordinator)" | head -20Repository: sopt-makers/SOPT-iOS
Length of output: 1691
๐ Script executed:
find . -type f -name "ApplicationCoordinator*"Repository: sopt-makers/SOPT-iOS
Length of output: 228
๐ Script executed:
find . -type f -name "*TabBar*" | head -20Repository: sopt-makers/SOPT-iOS
Length of output: 1244
๐ Script executed:
cat -n ./SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator+Delegate.swift | sed -n '40,80p'Repository: sopt-makers/SOPT-iOS
Length of output: 1877
๐ Script executed:
cat -n ./SOPT-iOS/Projects/Core/Sources/Enum/TabBarItemType.swiftRepository: sopt-makers/SOPT-iOS
Length of output: 1582
๐ Script executed:
cat -n ./SOPT-iOS/Projects/Features/TabBarFeature/Sources/Controller/TabBarController.swiftRepository: sopt-makers/SOPT-iOS
Length of output: 12545
๐ Script executed:
rg "selectedTab" --type swift -A 2 -B 2Repository: sopt-makers/SOPT-iOS
Length of output: 6547
๐ Script executed:
rg "TabBarItemType\." --type swift | grep -E "(rawValue|getTabIndex)"Repository: sopt-makers/SOPT-iOS
Length of output: 226
๐ Script executed:
cat -n ./SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift | head -100Repository: sopt-makers/SOPT-iOS
Length of output: 3753
๐ Script executed:
rg "userType" ./SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swiftRepository: sopt-makers/SOPT-iOS
Length of output: 1335
๐ Script executed:
cat -n ./SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift | grep -A 5 -B 5 "tabBarController.*="Repository: sopt-makers/SOPT-iOS
Length of output: 2411
๐ Script executed:
rg "UserDefaultKeyList.Auth.getUserType" ./SOPT-iOS/Projects/Features/RootFeature/Sources/ -A 2 -B 2Repository: sopt-makers/SOPT-iOS
Length of output: 1888
Fix tab selection to use getTabIndex(userType:) instead of rawValue to account for userType-specific tab ordering.
Currently, selectedTab() sets tabBarController?.selectedIndex = tab.rawValue, which causes incorrect tab navigation:
- For active users:
.soptamphas rawValue2, but actual index is1in the configured tab order[.home, .soptamp, .poke, .soptlog]. CallingselectedTab(.soptamp)navigates to the Poke tab instead. - For visitor/inactive users:
.soptloghas rawValue3, but actual index is2in the configured tab order[.home, .poke, .soptlog]. This causes an out-of-bounds index issue.
Since TabBarItemType.getTabIndex(userType:) already provides the correct mapping per userType, use it in both locations:
private func selectedTab(_ tab: TabBarItemType) {
let userType = UserDefaultKeyList.Auth.getUserType()
let index = tab.getTabIndex(userType: userType)
self.tabBarController?.selectedIndex = index
}And at line 71, use the selectedTab() method instead of rawValue:
case .soptlog:
selectedTab(.soptlog)This ensures all tab selections respect the userType-specific ordering defined in getTabIndex().
๐ค Prompt for AI Agents
In
SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator+Delegate.swift
around lines 50 to 52 (and adjust the call at line 71), selectedTab(_:)
currently uses tab.rawValue which fails for userType-specific tab ordering and
can produce incorrect navigation or out-of-bounds indexes; change it to fetch
the current userType via UserDefaultKeyList.Auth.getUserType(), call
tab.getTabIndex(userType:) to compute the correct index, and set
tabBarController?.selectedIndex to that computed index, and replace any direct
uses of rawValue (e.g., the case at line 71) with calls to selectedTab(.soptlog)
so all selections honor the userType mapping.
SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift
Show resolved
Hide resolved
|
์ข๋ค๊ณ ์๊ฐํฉ๋๋ค...๐๐ป |
๐ด PR ์์ฝ
ํญ๋ฐ ๋ณ๊ฒฝ์ ๋ฐ๋ฅธ ๋ฅ๋งํฌ ๋ฐฉ์ ๋ณ๊ฒฝ
๐ฑ ์์ ํ ๋ธ๋์น
๐ฑ PR Point
DeepLinkParser์ defaultDeeplink [home, soptlog] -> [home, soptamp, poke, soptlog] ๋ก ๋ณ๊ฒฝํ์ต๋๋ค.
๊ด๋ จ DeepLink ํ์ผ ์ฌ์ฉํ์ง ์๋ ๋ ๊ฑฐ์ ์ ๊ฑฐํ์ต๋๋ค.
TabBarCoordinator์์ index๋ฅผ ์ฐพ๋ ๋ก์ง๊ณผ ํญ๋ฐ ์ฌ์์ฑํ์ง ์๋๋ก ํ๋ ๋ก์ง ์ถ๊ฐํ์ต๋๋ค.
๐ธ ์คํฌ๋ฆฐ์ท
|
|
|
๐ฎ ๊ด๋ จ ์ด์