Conversation
📝 WalkthroughWalkthrough홈 화면의 프로필 아이콘 탭 시 마이페이지로 이동하는 네비게이션 흐름을 구현했습니다. HomeNavigationBarCell에 마이페이지 탭 콜백을 추가하고, HomeViewModel을 통해 네비게이션 신호를 처리하며, MyPageViewController로의 푸시 네비게이션을 추가했습니다. 또한 지역 드롭다운의 콜백 시그니처를 변경하여 CGRect 프레임 정보를 전달하도록 수정했습니다. Changes
Sequence DiagramsequenceDiagram
participant User
participant HomeNavigationBarCell
participant HomeViewController
participant HomeViewModel
participant NavigationManager
participant MyPageViewController
User->>HomeNavigationBarCell: Tap Profile Icon
HomeNavigationBarCell->>HomeNavigationBarCell: myPageTapped()
HomeNavigationBarCell->>HomeViewController: onMyPageTapped()
HomeViewController->>HomeViewModel: Send .myPageTapped Input
HomeViewModel->>HomeViewModel: handleInput(.myPageTapped)
HomeViewModel->>HomeViewController: Emit navToMyPage
HomeViewController->>HomeViewController: showMyPage()
HomeViewController->>NavigationManager: push(MyPageViewController)
NavigationManager->>MyPageViewController: Present
MyPageViewController-->>User: Show MyPage Screen
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@SMASHING/Global/Resource/Assets.xcassets/Icons/ic_profile.imageset/Contents.json`:
- Around line 4-15: 현재 ic_profile.imageset에 1x만 등록되어 있어 iPhone의 2x/3x에서 업스케일링으로
아이콘이 흐려집니다; ic_profile.png(현재 1x)와 동일한 아트워크의 2x, 3x 래스터 PNG 파일을 각각 추가하거나 벡터
PDF(또는 애셋에 벡터 옵션 활성화된 PDF)를 등록하여 Contents.json의 항목에 "filename" 속성으로 2x/3x(예:
ic_profile@2x.png, ic_profile@3x.png 또는 ic_profile.pdf)를 추가하고 idiom/scale 항목을 맞춰
업데이트하세요.
In `@SMASHING/Presentation/Home/Cell/HomeNavigationBarCell.swift`:
- Around line 68-71: Replace the UIImageView myPageImage in
HomeNavigationBarCell with a UIButton (e.g., myPageButton) so the control is
semantically a tappable element, set its image to .icProfile, preserve
contentMode/adjust imageView if needed, and ensure the touch target meets the
44x44 minimum (use contentEdgeInsets or constraints to enforce at least 44x44).
Also make the control accessible (set accessibilityLabel and
isAccessibilityElement = true) and continue using the existing tap gesture
handler by moving its target/action to the new UIButton.
In `@SMASHING/Presentation/Home/HomeViewController.swift`:
- Around line 602-604: When latestMyProfile is nil you must explicitly reset the
dropdown state instead of doing nothing; update the conditional around
latestMyProfile where you call dd.configure(profile: profile, myRegion:
myRegion) so that the else branch clears the selection and sets the current
region/empty state (e.g. call dd.configure(profile: nil, myRegion: myRegion) or
a dedicated dd.reset/clear method) to ensure default texts like "양천구"/"Sliver
III" are not reused, and apply the same change at the other occurrence
referenced (the block around lines 642-644).
- Around line 617-623: 현재 dd.onSportsCellTapped 클로저의 빈 종목 분기에서 바로
self.input.send(.addSportsTapped)만 호출해 홈 드롭다운과 dimView가 열린 채로 푸시되므로, 빈 종목을 탭할 때는
푸시 전에 드롭다운과 dimView를 닫아야 합니다; dd.onSportsCellTapped 내부(빈 종목 분기)에서 navigation 호출
전에 드롭다운을 닫는 로직을 추가하세요(예: dd.dismissDropdown(), dd.hideDimView(), 또는
HomeViewController의 드롭다운/디밍을 닫는 기존 메서드 호출) 후에 self.input.send(.addSportsTapped)를
호출하도록 변경하고 다른 분기(myProfileInput.send(.sportsCellTapped(sport)))는 그대로 유지하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7eb034b9-9cd0-4511-8748-a5fbb2c5aaa9
⛔ Files ignored due to path filters (1)
SMASHING/Global/Resource/Assets.xcassets/Icons/ic_profile.imageset/ic_profile.pngis excluded by!**/*.png
📒 Files selected for processing (6)
SMASHING/Global/Resource/Assets.xcassets/Icons/ic_profile.imageset/Contents.jsonSMASHING/Presentation/Home/Cell/HomeNavigationBarCell.swiftSMASHING/Presentation/Home/HomeDropDownView.swiftSMASHING/Presentation/Home/HomeViewController.swiftSMASHING/Presentation/Home/HomeViewModel.swiftSMASHING/Presentation/MyPage/MyPageViewController.swift
| "filename" : "ic_profile.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } |
There was a problem hiding this comment.
프로필 아이콘이 실기기에서 흐려질 수 있습니다.
지금 imageset에는 1x만 연결돼 있어서 2x/3x iPhone에서는 새 아이콘이 업스케일링됩니다. 최소한 2x/3x 자산을 같이 넣거나 벡터 PDF로 등록해 주세요.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@SMASHING/Global/Resource/Assets.xcassets/Icons/ic_profile.imageset/Contents.json`
around lines 4 - 15, 현재 ic_profile.imageset에 1x만 등록되어 있어 iPhone의 2x/3x에서 업스케일링으로
아이콘이 흐려집니다; ic_profile.png(현재 1x)와 동일한 아트워크의 2x, 3x 래스터 PNG 파일을 각각 추가하거나 벡터
PDF(또는 애셋에 벡터 옵션 활성화된 PDF)를 등록하여 Contents.json의 항목에 "filename" 속성으로 2x/3x(예:
ic_profile@2x.png, ic_profile@3x.png 또는 ic_profile.pdf)를 추가하고 idiom/scale 항목을 맞춰
업데이트하세요.
| private let myPageImage = UIImageView().then { | ||
| $0.image = .icProfile | ||
| $0.contentMode = .scaleAspectFit | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, find and examine the HomeNavigationBarCell.swift file
find . -name "HomeNavigationBarCell.swift" -type fRepository: TEAM-SMASHING/SMASHING-iOS
Length of output: 131
🏁 Script executed:
# Get the full file to understand the implementation
cat -n ./SMASHING/Presentation/Home/Cell/HomeNavigationBarCell.swiftRepository: TEAM-SMASHING/SMASHING-iOS
Length of output: 6181
🏁 Script executed:
# Search for UIButton minimum touch target size recommendations in iOS documentation
# and verify current implementation details
rg "addGestureRecognizer|UIImageView|myPageImage|myPageButton" SMASHING/Presentation/Home/Cell/HomeNavigationBarCell.swift -A 3Repository: TEAM-SMASHING/SMASHING-iOS
Length of output: 1983
마이페이지 아이콘을 접근성 기준에 맞춰 개선해야 합니다.
UIImageView에 제스처만 붙이고 24pt로 배치하면 버튼 역할이 명확하지 않고, 터치 영역도 iOS 권장 기준(44x44)보다 작아 접근성을 침해합니다. UIButton으로 변경하고 최소 44x44 터치 영역을 확보하세요.
수정 예시
- private let myPageImage = UIImageView().then {
- $0.image = .icProfile
- $0.contentMode = .scaleAspectFit
- }
+ private let myPageButton = UIButton(type: .custom).then {
+ $0.setImage(.icProfile, for: .normal)
+ $0.imageView?.contentMode = .scaleAspectFit
+ $0.accessibilityLabel = "마이페이지"
+ $0.accessibilityTraits = .button
+ }
...
- addSubviews(regionStackView, sportsAndTierStackView, bellImage, myPageImage)
+ addSubviews(regionStackView, sportsAndTierStackView, bellImage, myPageButton)
...
- let myPageTap = UITapGestureRecognizer(target: self, action: `#selector`(myPageTapped))
- myPageImage.isUserInteractionEnabled = true
- myPageImage.addGestureRecognizer(myPageTap)
+ myPageButton.addTarget(self, action: `#selector`(myPageTapped), for: .touchUpInside)
...
bellImage.snp.makeConstraints {
$0.centerY.equalToSuperview()
- $0.trailing.equalTo(myPageImage.snp.leading).offset(-12)
+ $0.trailing.equalTo(myPageButton.snp.leading).offset(-12)
$0.size.equalTo(24)
}
- myPageImage.snp.makeConstraints {
+ myPageButton.snp.makeConstraints {
$0.centerY.equalToSuperview()
$0.trailing.equalToSuperview()
- $0.size.equalTo(24)
+ $0.size.equalTo(44)
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@SMASHING/Presentation/Home/Cell/HomeNavigationBarCell.swift` around lines 68
- 71, Replace the UIImageView myPageImage in HomeNavigationBarCell with a
UIButton (e.g., myPageButton) so the control is semantically a tappable element,
set its image to .icProfile, preserve contentMode/adjust imageView if needed,
and ensure the touch target meets the 44x44 minimum (use contentEdgeInsets or
constraints to enforce at least 44x44). Also make the control accessible (set
accessibilityLabel and isAccessibilityElement = true) and continue using the
existing tap gesture handler by moving its target/action to the new UIButton.
| if let profile = latestMyProfile { | ||
| dd.configure(profile: profile, myRegion: myRegion) | ||
| } |
There was a problem hiding this comment.
프로필이 없을 때 드롭다운 상태가 갱신되지 않습니다.
latestMyProfile == nil이면 여기서 아무 설정도 하지 않아서, 첫 표시에서는 기본 텍스트(양천구, Sliver III)가 남고 재오픈 시에는 이전 프로필 값이 그대로 재사용될 수 있습니다. nil 분기에서도 현재 지역과 empty state를 명시적으로 reset해 주세요.
Also applies to: 642-644
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@SMASHING/Presentation/Home/HomeViewController.swift` around lines 602 - 604,
When latestMyProfile is nil you must explicitly reset the dropdown state instead
of doing nothing; update the conditional around latestMyProfile where you call
dd.configure(profile: profile, myRegion: myRegion) so that the else branch
clears the selection and sets the current region/empty state (e.g. call
dd.configure(profile: nil, myRegion: myRegion) or a dedicated dd.reset/clear
method) to ensure default texts like "양천구"/"Sliver III" are not reused, and
apply the same change at the other occurrence referenced (the block around lines
642-644).
| dd.onSportsCellTapped = { [weak self] sport in | ||
| guard let self else { return } | ||
| if let sport { | ||
| self.myProfileInput.send(.sportsCellTapped(sport)) | ||
| } else { | ||
| self.input.send(.addSportsTapped) | ||
| } |
There was a problem hiding this comment.
빈 종목 셀에서 Add Sports로 갈 때 드롭다운을 먼저 닫아주세요.
이 분기에서는 .addSportsTapped만 보내고 있어서 홈 드롭다운과 dimView가 열린 채로 화면이 push됩니다. 뒤로 돌아오면 오버레이가 그대로 남습니다.
예시 수정
dd.onSportsCellTapped = { [weak self] sport in
guard let self else { return }
if let sport {
self.myProfileInput.send(.sportsCellTapped(sport))
} else {
+ self.hideDropDown()
self.input.send(.addSportsTapped)
}
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@SMASHING/Presentation/Home/HomeViewController.swift` around lines 617 - 623,
현재 dd.onSportsCellTapped 클로저의 빈 종목 분기에서 바로 self.input.send(.addSportsTapped)만
호출해 홈 드롭다운과 dimView가 열린 채로 푸시되므로, 빈 종목을 탭할 때는 푸시 전에 드롭다운과 dimView를 닫아야 합니다;
dd.onSportsCellTapped 내부(빈 종목 분기)에서 navigation 호출 전에 드롭다운을 닫는 로직을 추가하세요(예:
dd.dismissDropdown(), dd.hideDimView(), 또는 HomeViewController의 드롭다운/디밍을 닫는 기존
메서드 호출) 후에 self.input.send(.addSportsTapped)를 호출하도록 변경하고 다른
분기(myProfileInput.send(.sportsCellTapped(sport)))는 그대로 유지하세요.
✅ Check List
📌 Related Issue
📎 Work Description
📷 Screenshots
💬 To Reviewers
Summary by CodeRabbit
릴리스 노트