Skip to content

Conversation

@juri123123
Copy link
Contributor

๐ŸŒด PR ์š”์•ฝ

ํƒญ๋ฐ” ๋ณ€๊ฒฝ์— ๋”ฐ๋ฅธ ๋”ฅ๋งํฌ ๋ฐฉ์‹ ๋ณ€๊ฒฝ

๐ŸŒฑ ์ž‘์—…ํ•œ ๋ธŒ๋žœ์น˜

๐ŸŒฑ PR Point

DeepLinkParser์˜ defaultDeeplink [home, soptlog] -> [home, soptamp, poke, soptlog] ๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค.
๊ด€๋ จ DeepLink ํŒŒ์ผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๋ ˆ๊ฑฐ์‹œ ์ œ๊ฑฐํ–ˆ์Šต๋‹ˆ๋‹ค.
TabBarCoordinator์—์„œ index๋ฅผ ์ฐพ๋Š” ๋กœ์ง๊ณผ ํƒญ๋ฐ” ์žฌ์ƒ์„ฑํ•˜์ง€ ์•Š๋„๋ก ํ•˜๋Š” ๋กœ์ง ์ถ”๊ฐ€ํ–ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท

|Simulator Screen Recording - iPhone 16 Pro - 2025-12-03 at 23 10 33|Simulator Screen Recording - iPhone 16 Pro - 2025-12-03 at 23 11 46|

๐Ÿ“ฎ ๊ด€๋ จ ์ด์Šˆ

@juri123123 juri123123 self-assigned this Dec 3, 2025
@juri123123 juri123123 added Feat ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๊ตฌํ˜„ Refactor ์ „๋ฉด ์ˆ˜์ • labels Dec 3, 2025
@juri123123 juri123123 linked an issue Dec 3, 2025 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Summary by CodeRabbit

๋ฆด๋ฆฌ์Šค ๋…ธํŠธ

  • ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ

    • ๋”ฅ๋งํ‚น ๊ธฐ๋Šฅ์ด ๋” ๋งŽ์€ ๋„ค๋น„๊ฒŒ์ด์…˜ ๊ฒฝ๋กœ๋ฅผ ์ง€์›ํ•˜๋„๋ก ํ™•์žฅ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
  • ๋ฒ„๊ทธ ์ˆ˜์ •

    • ํƒญ ๋„ค๋น„๊ฒŒ์ด์…˜์˜ ์•ˆ์ •์„ฑ์ด ๊ฐœ์„ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
  • ๋ฆฌํŒฉํ„ฐ๋ง

    • ์•ฑ ๋‚ด ๋„ค๋น„๊ฒŒ์ด์…˜ ๋กœ์ง์ด ํ†ตํ•ฉ ๋ฐ ์ตœ์ ํ™”๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

โœ๏ธ Tip: You can customize this high-level summary in your review settings.

Walkthrough

TabBar ์ดˆ๊ธฐ ์„ ํƒ ์ธ์ž๊ฐ€ ๋„์ž…๋˜์–ด ๋”ฅ๋งํฌ๋“ค์ด ๋ชฉ์ ์ง€์ผ ๋•Œ ํ•ด๋‹น ํƒญ์œผ๋กœ ์ง์ ‘ ๋ผ์šฐํŒ…ํ•˜๋„๋ก ๋ณ€๊ฒฝ๋˜์—ˆ๊ณ , TabBarItemType์— ํƒญ ์ธ๋ฑ์Šค ํ—ฌํผ์™€ soptamp ์ผ€์ด์Šค๋ช…์ด ์ถ”๊ฐ€/์ˆ˜์ •๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Changes

์ฝ”ํ˜ธํŠธ / ํŒŒ์ผ(s) ๋ณ€๊ฒฝ ์š”์•ฝ
ApplicationCoordinator ํƒญ๋ฐ” ํ˜ธ์ถœ
SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift
runTabBarFlow ์‹œ initSelectedTabType: TabBarItemType ์ „๋‹ฌํ•˜๋„๋ก ์‹œ๊ทธ๋‹ˆ์ฒ˜/ํ˜ธ์ถœ ๋ณ€๊ฒฝ
๋”ฅ๋งํฌ โ€” ํƒญ ๋ฐ”๋กœ ๋ผ์šฐํŒ…
SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/HomeDeepLink.swift, .../PokeDeepLink.swift, .../SoptampDeepLink.swift, .../SoptlogDeepLink.swift
isDestination์ผ ๋•Œ coordinator.runTabBarFlow(initSelectedTabType: .<tab>) ํ˜ธ์ถœ๋กœ ํƒญ๋ฐ” ๊ฒฝ๋กœ๋กœ ์ง์ ‘ ๋ฐ˜ํ™˜; ์ผ๋ถ€ ํŒŒ์ผ์—์„œ Core import ์ œ๊ฑฐ ๋ฐ ๊ธฐ์กด ๋Œ€์ฒด ํ๋ฆ„ ๋ณด์กด(๋น„-๋ชฉ์ ์ง€)
DeepLink ํŒŒ์„œ ํ™•์žฅ
SOPT-iOS/Projects/Features/RootFeature/Sources/NotificationHelpers/Parser/DeepLinkParser.swift
๋ฃจํŠธ ๋”ฅ๋งํฌ์— "soptamp" ๋ฐ "poke" ์ผ€์ด์Šค ์ถ”๊ฐ€ ๋ฐ defaultDeepLinks์— ํฌํ•จ
TabBarCoordinator โ€” ์ดˆ๊ธฐ ์„ ํƒ ์ง€์›
SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift
selectedTabType: TabBarItemType ํ”„๋กœํผํ‹ฐ/์ดˆ๊ธฐํ™” ์ธ์ž ์ถ”๊ฐ€; start()์—์„œ ๊ธฐ์กด ํƒญ ๋ฐ” ์žฌ์‚ฌ์šฉ ์‹œ ์„ ํƒ ์ธ๋ฑ์Šค ์„ค์ • ๋ฐ showTabBar()์—์„œ ์ดˆ๊ธฐ ์„ ํƒ ๋ฐ˜์˜
ํƒญ ํƒ€์ž… ๋ณ€๊ฒฝ ๋ฐ ํ—ฌํผ ์ถ”๊ฐ€
SOPT-iOS/Projects/Core/Sources/Enum/TabBarItemType.swift
soptstamp โ†’ soptamp๋กœ ์ผ€์ด์Šค๋ช… ์ˆ˜์ •, getTabIndex(userType:) -> Int ๊ณต๊ฐœ ๋ฉ”์„œ๋“œ ์ถ”๊ฐ€(์‚ฌ์šฉ์ž ์œ ํ˜•๋ณ„ ์ธ๋ฑ์Šค ๋งคํ•‘)
์ธํ„ฐํŽ˜์ด์Šค ํƒ€์ž… ์ œ๊ฑฐ
SOPT-iOS/Projects/Features/TabBarFeature/Interface/Sources/TabType.swift
TabType enum ํŒŒ์ผ ์‚ญ์ œ(๋Œ€์ฒด๋กœ TabBarItemType ์‚ฌ์šฉ์œผ๋กœ ์ „ํ™˜)
UI/๋ฌธ๊ตฌ ๋™๊ธฐํ™”
SOPT-iOS/Projects/Features/TabBarFeature/Sources/Components/TabBarItem.swift, .../Controller/TabBarController.swift
soptstamp โ†’ soptamp ๋ถ„๊ธฐ ๋ ˆ์ด๋ธ”ยท์ด๋ฏธ์ง€ยทํƒ€์ดํ‹€ ์—…๋ฐ์ดํŠธ; ํ™œ์„ฑ ์‚ฌ์šฉ์ž ์ฒ˜๋ฆฌ์—์„œ soptamp ์ฐธ์กฐ๋กœ ๋ณ€๊ฒฝ
Delegate ํ—ฌํผ ํƒ€์ž… ๊ต์ฒด
SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator+Delegate.swift
private helper ํŒŒ๋ผ๋ฏธํ„ฐ ํƒ€์ž… TabType โ†’ TabBarItemType์œผ๋กœ ๋ณ€๊ฒฝ ๋ฐ ์ฐธ์กฐ ์—…๋ฐ์ดํŠธ
ํ™ˆ ๋ทฐ๋ชจ๋ธ ์•ฑ ์„œ๋น„์Šค ๊ฐ„์†Œํ™”
SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift
AppService ์ฒ˜๋ฆฌ์—์„œ poke ํŠน์ˆ˜ ๋ถ„๊ธฐ ์ œ๊ฑฐ(ํ•ญ์ƒ onAppServiceCellTapped ํ˜ธ์ถœ), poke ๊ด€๋ จ ๋กœ์ง ์ฃผ์„ํ™”/๋น„ํ™œ์„ฑํ™”

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
Loading

Estimated code review effort

๐ŸŽฏ 3 (Moderate) | โฑ๏ธ ~20 minutes

๊ฒ€ํ†  ์‹œ ์ฃผ์˜ ์‚ฌํ•ญ:

  • TabBarItemType.getTabIndex(userType:)์˜ ์ธ๋ฑ์Šค ๋งคํ•‘(ํ™œ์„ฑ/๋น„ํ™œ์„ฑ/๋ฐฉ๋ฌธ์ž) ๊ฒ€์ฆ
  • ๋ชจ๋“  TabBarCoordinator ์ƒ์„ฑ ํ˜ธ์ถœ๋ถ€๊ฐ€ ์ƒˆ ์‹œ๊ทธ๋‹ˆ์ฒ˜(selectedTabType)๋ฅผ ๋”ฐ๋ฅด๋Š”์ง€ ํ™•์ธ
  • TabType ์‚ญ์ œ๋กœ ๋‚จ์•„์žˆ๋Š” ๋ ˆ๊ฑฐ์‹œ ์ฐธ์กฐ ์œ ๋ฌด ์ ๊ฒ€
  • ๋”ฅ๋งํฌ ๊ฒฝ๋กœ๋“ค์—์„œ isDestination๊ณผ ๋น„-๋ชฉ์ ์ง€ ๋ถ„๊ธฐ ๋กœ์ง์ด ์ผ๊ด€๋œ์ง€ ํ™•์ธ

Possibly related PRs

Suggested reviewers

  • dlwogus0128
  • hye0njuoo
  • yungu0010

Poem

๐Ÿฐ ํด์ง, ํƒญ์„ ๊ณจ๋ผ ๋›ฐ์–ด๋“ค์–ด,
๋ชฉ์ ์ง€ ํ–ฅํ•œ ๊ธธ์ด ํ•˜๋‚˜๋กœ ์ด์–ด์ง€๋„ค.
ํ•œ ๋ฒˆ์˜ ์„ ํƒ, ํ•œ ์ค„์˜ ์ฝ”๋“œ๋กœ,
๋‹น๊ทผ ๋“  ์ฝ”๋””๋„ค์ดํ„ฐ์™€ ํ•จ๊ป˜ ํด์งโ€”
์ถ•ํ•˜ํ•ด์š”, ํƒญ์ด ๋ฐ˜์ง์˜€์–ด์š”!

Pre-merge checks and finishing touches

โŒ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes check โš ๏ธ Warning HomeForMemberViewModel์˜ AppService ์ผ€์ด์Šค์—์„œ poke ๊ด€๋ จ ๋กœ์ง์ด ๋น„ํ™œ์„ฑํ™”๋˜์—ˆ๋Š”๋ฐ, ์ด๋Š” #761์˜ ๋”ฅ๋งํฌ ๋ฆฌํŒฉํ† ๋ง ๋ฒ”์œ„๋ฅผ ๋ฒ—์–ด๋‚˜ ๋ณด์ž…๋‹ˆ๋‹ค. HomeForMemberViewModel์˜ poke ๋กœ์ง ๋น„ํ™œ์„ฑํ™”๊ฐ€ #761 ๋”ฅ๋งํฌ ๋ฆฌํŒฉํ† ๋ง์˜ ๋ฒ”์œ„์— ์†ํ•˜๋Š”์ง€ ๋ช…ํ™•ํžˆ ํ•˜๊ณ , ํ•„์š”์‹œ ํ•ด๋‹น ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ๋ณ„๋„ PR๋กœ ๋ถ„๋ฆฌํ•˜๊ฑฐ๋‚˜ ์ด์Šˆ์— ์ถ”๊ฐ€ํ•˜์„ธ์š”.
Docstring Coverage โš ๏ธ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
โœ… Passed checks (3 passed)
Check name Status Explanation
Title check โœ… Passed PR ์ œ๋ชฉ์€ ๋”ฅ๋งํฌ ๋ฆฌํŒฉํ† ๋ง์ด๋ผ๋Š” ์ฃผ์š” ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ๋ช…ํ™•ํ•˜๊ฒŒ ์š”์•ฝํ•˜๊ณ  ์žˆ์œผ๋ฉฐ, ๋ณ€๊ฒฝ ์‚ฌํ•ญ๊ณผ ์ž˜ ๋ถ€ํ•ฉํ•ฉ๋‹ˆ๋‹ค.
Description check โœ… Passed PR ์„ค๋ช…์ด ํƒญ๋ฐ” ๋ณ€๊ฒฝ์— ๋”ฐ๋ฅธ ๋”ฅ๋งํฌ ๋ฐฉ์‹ ๋ณ€๊ฒฝ, DeepLinkParser ์—…๋ฐ์ดํŠธ, ๋ ˆ๊ฑฐ์‹œ ์ œ๊ฑฐ, TabBarCoordinator ๋กœ์ง ์ถ”๊ฐ€ ๋“ฑ ๋ณ€๊ฒฝ์‚ฌํ•ญ๊ณผ ๊ด€๋ จ์ด ์žˆ์Šต๋‹ˆ๋‹ค.
Linked Issues check โœ… Passed PR์€ #761 ์ด์Šˆ์˜ ๋ชฉํ‘œ์ธ 'ํƒญ๋ฐ” ๋ณ€๋™์— ๋”ฐ๋ฅธ ๋”ฅ๋งํฌ ๊ฒฝ๋กœ ์ˆ˜์ •'์„ ์ถฉ๋ถ„ํžˆ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค. DeepLinkParser ์—…๋ฐ์ดํŠธ, ํƒญ ์ธ๋ฑ์Šค ๋กœ์ง ์ถ”๊ฐ€, ๋”ฅ๋งํฌ ์‹คํ–‰ ๋กœ์ง ์ˆ˜์ • ๋“ฑ์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
โœจ Finishing touches
  • ๐Ÿ“ Generate docstrings
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#761-deeplink-refactor

๐Ÿ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between c7fd769 and b090952.

๐Ÿ“’ Files selected for processing (2)
  • SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift (1 hunks)
  • SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift (3 hunks)
๐Ÿงฐ Additional context used
๐Ÿง  Learnings (2)
๐Ÿ“š 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/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift
๐Ÿ“š 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/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift
๐Ÿงฌ Code graph analysis (1)
SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift (2)
SOPT-iOS/Projects/Core/Sources/Enum/TabBarItemType.swift (1)
  • getTabIndex (29-52)
SOPT-iOS/Projects/Features/TabBarFeature/Sources/Controller/TabBarController.swift (1)
  • tabBar (262-265)
๐Ÿ”‡ Additional comments (5)
SOPT-iOS/Projects/Features/HomeFeature/Sources/HomeScene/ViewModel/HomeForMemberViewModel.swift (2)

87-87: onPoke ์ฝœ๋ฐฑ์€ ํ™œ๋ฐœํžˆ ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค

onPoke ์ฝœ๋ฐฑ์€ HomeCoordinator์™€ LegacyHomeCoordinator์—์„œ ํ™œ๋ฐœํžˆ ์‚ฌ์šฉ๋˜๊ณ  ์žˆ์œผ๋ฏ€๋กœ ์ œ๊ฑฐํ•ด์„œ๋Š” ์•ˆ ๋ฉ๋‹ˆ๋‹ค. ์ฝœ๋ฐฑ์€ ํฌํฌ ํ”ผ์ฒ˜๋กœ์˜ ๋„ค๋น„๊ฒŒ์ด์…˜์„ ์ฒ˜๋ฆฌํ•˜๋Š” ํ•ต์‹ฌ ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค.


140-150: The code at lines 140-150 is already clean and does not require the suggested cleanup.

The #warning comment and commented-out "์ฝ•์ฐŒ๋ฅด๊ธฐ" conditional logic are not present in the current code. The onAppServiceCellTapped call is implemented cleanly without temporary markers or pending cleanup, which means the refactoring to unified deeplink handling has already been completed properly.

Likely an incorrect or invalid review comment.

SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift (3)

35-51: ์„ ํƒ ํƒญ ํƒ€์ž…์„ ์ฃผ์ž…ํ•˜๋Š” ๊ตฌ์กฐ๊ฐ€ ๋”ฅ๋งํฌ ์š”๊ตฌ์‚ฌํ•ญ์— ์ž˜ ๋งž์Šต๋‹ˆ๋‹ค.

selectedTabType๋ฅผ ์ƒ์„ฑ์ž ์ธ์ž๋กœ ๋ฐ›๊ณ  ๊ธฐ๋ณธ๊ฐ’์„ .home์œผ๋กœ ๋‘” ์„ค๊ณ„๊ฐ€ ์ž์—ฐ์Šค๋Ÿฝ๊ณ , ํƒญ๋ฐ” ์ดˆ๊ธฐ ์ง„์ž…/๋”ฅ๋งํฌ ๋ชจ๋‘์—์„œ ๋™์ผํ•œ ๊ฒฝ๋กœ๋กœ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์–ด ๋ณด์ž…๋‹ˆ๋‹ค. ๋ถˆ๋ณ€(let) + private ์Šค์ฝ”ํ”„๋กœ ๋‘” ๊ฒƒ๋„ ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค.


55-62: ๊ธฐ์กด UITabBarController ์žฌ์‚ฌ์šฉ ์‹œ tabBarController ๋™๊ธฐํ™”๊นŒ์ง€ ์ด๋ค„์ง„ ์  ์ข‹์Šต๋‹ˆ๋‹ค.

์ด์ œ ๋„ค๋น„๊ฒŒ์ด์…˜ ์Šคํƒ์˜ ์ฒซ ๋ทฐ๊ฐ€ UITabBarController์ธ ๊ฒฝ์šฐ tabBarController ํ”„๋กœํผํ‹ฐ๋„ ํ•จ๊ป˜ ์„ธํŒ…ํ•˜๊ณ , selectedTabType.getTabIndex(userType:)๋กœ ๋ฐ”๋กœ ์„ ํƒ ํƒญ์„ ๊ฐฑ์‹ ํ•ด์„œ, ์ƒ์œ„ ApplicationCoordinator ๋“ฑ์—์„œ ์žฌํ˜ธ์ถœ๋˜๋”๋ผ๋„ ์ฐธ์กฐ๊ฐ€ ๋Š๊ธฐ์ง€ ์•Š๊ณ  ์ •์ƒ ๋™์ž‘ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.


105-106: ์ดˆ๊ธฐ ์„ ํƒ ํƒญ ์ธ๋ฑ์Šค๋ฅผ getTabIndex(userType:)๋กœ ๊ณ„์‚ฐํ•˜๋Š” ๋ถ€๋ถ„์€ ์ผ๊ด€๋œ ์„ค๊ณ„์ž…๋‹ˆ๋‹ค.

selectedTabType๊ณผ userType๋ฅผ ํ•จ๊ป˜ ์‚ฌ์šฉํ•ด ์ดˆ๊ธฐ์— ํ‘œ์‹œ๋  ํƒญ์„ ๊ฒฐ์ •ํ•˜๋Š” ๋ถ€๋ถ„์ด, ์œ„์—์„œ ์ œ์•ˆ๋“œ๋ฆฐ index โ†”๏ธŽ TabBarItemType ๋งคํ•‘ ๋ณด์™„๊ณผ๋„ ์ž˜ ๋งž๋Š” ๊ตฌ์กฐ๋ผ ์œ ์ง€ ๋ณด์ˆ˜์— ์œ ๋ฆฌํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.


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.

โค๏ธ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between d8300f1 and 483ea75.

๐Ÿ“’ 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.swift
  • SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptampDeepLink.swift
  • SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/HomeDeepLink.swift
  • SOPT-iOS/Projects/Features/RootFeature/Sources/DeepLinks/SoptlogDeepLink.swift
  • SOPT-iOS/Projects/Features/TabBarFeature/Sources/Coordinator/TabBarCoordinator.swift
  • SOPT-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

@juri123123 juri123123 changed the title Refactor/#761 deeplink refactor [Refactor] #761 deeplink refactor Dec 5, 2025
@juri123123 juri123123 changed the title [Refactor] #761 deeplink refactor [Refactor] #761 - deeplink refactor Dec 5, 2025
Copy link
Member

@hye0njuoo hye0njuoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹น ์ฝ”๋“œ ๋„˜ ๊น”๋”ํ•˜๋„ค์š”!!

Copy link
Member

@yungu0010 yungu0010 left a 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
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showTabBar ๋ฉ”์†Œ๋“œ ๋‚ด์—์„œ๋„ selectedIndex๋ฅผ ์ง€์ •ํ•ด์ฃผ๊ณ  ์žˆ๋Š”๋ฐ ๋ถ„๊ธฐ์ฒ˜๋ฆฌ๋ฅผ ํ•˜์‹  ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”?

Copy link
Contributor Author

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด ๋ฉ”์„œ๋“œ๋Š” TabBarItemType.swift๋กœ ์˜ฎ๊ธฐ๋Š”๊ฑฐ ์–ด๋– ์‹ ๊ฐ€์š”? (ํƒญ๋ฐ” ์•„์ดํ…œ์˜ ์†์„ฑ์ด๋ผ๋Š” ์ƒ๊ฐ์ด ๋“ค์–ด์„œ์š”!)

@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 10, 2025
Copy link

@coderabbitai coderabbitai bot left a 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 ordering

The 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 .soptamp

Since 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 to TabBarItemType that reverses the getTabIndex logic, 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

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 483ea75 and c7fd769.

๐Ÿ“’ 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.swift
  • SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift
  • SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator+Delegate.swift
  • SOPT-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() ๋กœ ๊ทธ๋Œ€๋กœ ์ง„์ž…ํ•˜๋Š” ๊ตฌ์กฐ๋ผ, ๋‹ค๋ฅธ ๋”ฅ๋งํฌ๋“ค๊ณผ ์ผ๊ด€๋˜๊ณ  ์ดํ•ดํ•˜๊ธฐ ์‰ฝ์Šต๋‹ˆ๋‹ค.

Comment on lines +50 to 52
private func selectedTab(_ tab: TabBarItemType) {
self.tabBarController?.selectedIndex = tab.rawValue
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โš ๏ธ Potential issue | ๐ŸŸ  Major

๐Ÿงฉ Analysis chain

๐Ÿ Script executed:

find . -type f -name "*.swift" | grep -E "(TabBar|ApplicationCoordinator)" | head -20

Repository: 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 -20

Repository: 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.swift

Repository: sopt-makers/SOPT-iOS

Length of output: 1582


๐Ÿ Script executed:

cat -n ./SOPT-iOS/Projects/Features/TabBarFeature/Sources/Controller/TabBarController.swift

Repository: sopt-makers/SOPT-iOS

Length of output: 12545


๐Ÿ Script executed:

rg "selectedTab" --type swift -A 2 -B 2

Repository: 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 -100

Repository: sopt-makers/SOPT-iOS

Length of output: 3753


๐Ÿ Script executed:

rg "userType" ./SOPT-iOS/Projects/Features/RootFeature/Sources/ApplicationCoordinator.swift

Repository: 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 2

Repository: 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: .soptamp has rawValue 2, but actual index is 1 in the configured tab order [.home, .soptamp, .poke, .soptlog]. Calling selectedTab(.soptamp) navigates to the Poke tab instead.
  • For visitor/inactive users: .soptlog has rawValue 3, but actual index is 2 in 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.

@angryPodo
Copy link
Member

์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค...๐Ÿ‘๐Ÿป

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feat ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๊ตฌํ˜„ Refactor ์ „๋ฉด ์ˆ˜์ • size/L ์ฃผ๋ฆฌ๐Ÿซ

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] ๋”ฅ๋งํฌ ์ˆ˜์ •

5 participants