Skip to content

feat: 바텀시트 컴포넌트 개발#80

Merged
clxxrlove merged 21 commits into
developfrom
BOOK-115-feature/#65
Jul 14, 2025
Merged

feat: 바텀시트 컴포넌트 개발#80
clxxrlove merged 21 commits into
developfrom
BOOK-115-feature/#65

Conversation

@doyeonk429
Copy link
Copy Markdown
Member

@doyeonk429 doyeonk429 commented Jul 12, 2025

🔗 관련 이슈

📘 작업 유형

  • ✨ Feature (기능 추가)
  • 🐞 Bugfix (버그 수정)
  • 🔧 Refactor (코드 리팩토링)
  • ⚙️ Chore (환경 설정)
  • 📝 Docs (문서 작성 및 수정)
  • ✅ Test (기능 테스트)
  • 🎨 style (코드 스타일 수정)

📙 작업 내역 - 1 @doyeonk429

  • 바텀시트 타이틀 스타일 정의
  • 바텀시트 프로토콜 및 구현체 정의/구현
  • 바텀시트 content 타이틀뷰 factory 구현

📙 작업 내역 - 2 @clxxrlove

  • 바텀시트 재설계
  • 바텀시트 프로토콜 삭제
  • 카탈로그에 반영

🧪 테스트 내역

  • 브라우저/기기에서 동작 확인
  • 엣지 케이스 테스트 완료
  • 기존 기능 영향 없음
    ~ 바텀시트 iphone SE vs ETC 기기에서 레이아웃 오류 발생 -> iphoneSE에서 레이아웃 겹침 현상 발생 / 해결~

🎨 스크린샷 또는 시연 영상 - 1

기능 미리보기 기능 미리보기
iPhone SE iPhone 13 iPhone 16 Pro
레이아웃 버그 수정 시도(SE 제외하고 정상 작동)

🎨 스크린샷 또는 시연 영상 - 2

기능 미리보기 기능 미리보기
iPhone SE iPhone 13 Pro iPhone 16
수정본

기종은 좀 다릅니다만 여러 기기에서 테스트 확인했습니다.

✅ PR 체크리스트

  • 커밋 메시지가 명확합니다
  • PR 제목이 컨벤션에 맞습니다
  • 관련 이슈 번호를 작성했습니다
  • 기능이 정상적으로 작동합니다
  • 불필요한 코드를 제거했습니다

💬 추가 설명 or 리뷰 포인트 (선택)

@doyeonk429

  • @clxxrlove help... 주요 파일은,, BKBottomSheetTitleView.swift, BKBottomSheetViewController.swift

@clxxrlove

  • 수정했습니다. 시간 나실때 리뷰 부탁드려요. @doyeonk429

Summary by CodeRabbit

  • 신규 기능

    • 커스터마이즈 가능한 하단 시트 UI 컴포넌트 및 스타일(BKBottomSheetStyle) 추가
    • 하단 시트 타이틀 뷰(BKBottomSheetTitleView), 딤 뷰(BKDimView), 버튼 그룹 지원 등 UI 요소 제공
    • 하단 시트 테스트 및 데모용 뷰 컨트롤러와 테스트 메뉴 추가
    • 카탈로그 뷰에 하단 시트 관련 버튼 추가 및 기능 연동
  • UI 개선

    • 버튼 그룹, 검색 필드, 설정 화면 등 컴포넌트의 여백 및 패딩 조정
    • 커스텀 라벨(BKLabel), 구분선(BKDivider) 적용으로 UI 일관성 강화
  • 리팩터링/스타일

    • SnapKit 제약 조건 코드 간소화 및 스타일 개선
  • 기타

    • 그래픽 시스템 상수(BKInset, BKRadius) 값 추가 및 조정

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 12, 2025

"""

Walkthrough

새로운 BottomSheet 컴포넌트와 관련된 여러 Swift UI 클래스 및 뷰 컨트롤러가 추가되었으며, 기존 컴포넌트의 레이아웃과 그래픽 시스템 상수 일부가 변경되었습니다. BottomSheet의 타이틀, X 버튼, 버튼 그룹, 레이아웃 스타일 등이 구현되어 테스트 및 프리뷰가 가능하도록 구성되었습니다.

Changes

파일/그룹 변경 요약
.../BKBottomSheetTitleView.swift, .../BKBottomSheetViewController.swift, .../BKDimView.swift, .../BKBottomSheetStyle.swift BottomSheet 타이틀 뷰, 전체 시트 컨트롤러, 딤 뷰, 스타일 enum 등 BottomSheet 핵심 컴포넌트 신규 추가
.../BKBottomSheetTestMenuViewController.swift, .../BKBottomSheetTitleTestView.swift, .../BKBottomSheetTitleViewController.swift BottomSheet 프리뷰 및 테스트용 뷰/뷰컨트롤러 신규 추가
.../CatalogViewController.swift BottomSheet 관련 버튼 및 네비게이션 액션 추가
.../BKButtonGroup.swift 버튼 그룹의 stackView에 패딩 적용 방식 변경
.../BKButton.swift SnapKit 제약조건 클로저 문법 간소화(기능 변화 없음)
.../BKSearchTextField.swift 텍스트필드 내부 인셋 및 버튼 위치 조정
.../BKInset.swift, .../BKRadius.swift 인셋 및 라운드 값 수정 및 신규 상수 추가
.../BKButtonGroupDemoViewController.swift 커스텀 라벨/디바이더 컴포넌트 사용으로 코드 단순화(기능 변화 없음)
.../SettingCell.swift, .../SettingView.swift 인셋 값 변경으로 레이아웃 미세 조정

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CatalogViewController
    participant BKBottomSheetTestMenuViewController
    participant BKBottomSheetViewController
    participant BKDimView

    User->>CatalogViewController: 버튼 클릭
    CatalogViewController->>BKBottomSheetTestMenuViewController: push/present
    User->>BKBottomSheetTestMenuViewController: 시트 테스트 버튼 클릭
    BKBottomSheetTestMenuViewController->>BKBottomSheetViewController: 인스턴스 생성 및 show(from:)
    BKBottomSheetViewController->>BKDimView: 딤 뷰 추가 및 탭 핸들러 등록
    BKBottomSheetViewController->>User: 바텀시트 표시
    User->>BKDimView: 딤 영역 탭
    BKDimView->>BKBottomSheetViewController: tapHandler 호출
    BKBottomSheetViewController->>User: 바텀시트 닫힘
Loading

Assessment against linked issues

Objective Addressed Explanation
바텀시트 텍스트 타이틀 구현, 바텀시트 xButton 구현, 바텀시트 기본 버튼 구현, 바텀시트 레이아웃 구현 (#65)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
BKButtonGroupDemoViewController에서 커스텀 라벨/디바이더 컴포넌트 사용으로 코드 단순화 (src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonGroupDemoViewController.swift) BottomSheet 개발과 직접적인 관련이 없으며, 데모 뷰의 UI 코드 리팩터링임.
BKSearchTextField 내부 인셋 및 버튼 위치 조정 (src/Projects/BKDesign/Sources/Components/BKSearchTextField.swift) BottomSheet와 무관한 검색 텍스트필드의 레이아웃 변경임.
BKInset, BKRadius 값 변경 및 신규 상수 추가 (src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BKInset.swift, BKRadius.swift) 일부 인셋/라운드 값의 변경은 BottomSheet에 쓰이지만, 다른 컴포넌트에도 영향을 줄 수 있어 범위를 벗어날 수 있음.
SettingCell, SettingView의 인셋 값 변경 (src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingCell.swift, SettingView.swift) BottomSheet와 직접 관련 없는 설정 화면 레이아웃 미세 조정임.

Suggested reviewers

  • doyeonk429
    """
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-115-feature/#65

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @coderabbitai 요약 to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@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: 3

🧹 Nitpick comments (4)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKDimView.swift (1)

6-6: 접근 제어자를 명시해주세요.

tapHandler 프로퍼티에 public 접근 제어자를 추가하는 것이 좋겠습니다.

-    var tapHandler: (() -> Void)?
+    public var tapHandler: (() -> Void)?
src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (1)

33-42: 모든 타이틀 스타일을 효과적으로 테스트하는 구조입니다.

5가지 스타일을 모두 시각적으로 확인할 수 있도록 잘 구현되었습니다. 테스트 목적에 매우 적합합니다.

만약 성능 최적화를 원한다면 루프 내에서 제약조건을 설정하는 대신 스택뷰에 추가한 후 일괄적으로 제약조건을 설정하는 것을 고려할 수 있습니다:

        styles.forEach { style in
            let titleView = BKBottomSheetTitleView(style: style)
            titleView.backgroundColor = UIColor.white
-            
-            titleView.snp.makeConstraints { make in
-                make.height.lessThanOrEqualTo(54)
-            }
            stackView.addArrangedSubview(titleView)
-        
         }
+        
+        stackView.arrangedSubviews.forEach { view in
+            view.snp.makeConstraints { make in
+                make.height.lessThanOrEqualTo(54)
+            }
+        }
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetContent.swift (1)

3-3: 사용하지 않는 import 제거

SnapKit이 import되어 있지만 실제로 사용되지 않습니다.

-import SnapKit
 import UIKit
src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift (1)

39-44: 사용하지 않는 속성 제거

examplebottomSheet 속성이 선언되어 있지만 실제로 사용되지 않습니다. presentExampleBottomSheet 메서드에서는 동일한 이름의 로컬 변수를 새로 생성하여 사용하고 있습니다.

-    private let examplebottomSheet = BKBottomSheetViewController(
-        titleStyle: .titleWithCloseButton(title: "예시 바텀시트에요"),
-        contentView: UIImageView(image: BKImage.Icon.search),
-        buttonConfiguration: BKButtonGroup.singleFullButton(),
-        preferredHeight: .fixed(200)
-    )
-    
-    
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f3805b5 and bec742e.

📒 Files selected for processing (11)
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (1 hunks)
  • src/Projects/BKDesign/PreviewApp/Sources/View/BottomSheetTitleViewController.swift (1 hunks)
  • src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift (5 hunks)
  • src/Projects/BKDesign/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json (0 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetContent.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetProtocol.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleStyle.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKDimView.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift (1 hunks)
💤 Files with no reviewable changes (1)
  • src/Projects/BKDesign/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#69
File: src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift:57-70
Timestamp: 2025-07-10T14:01:04.933Z
Learning: clxxrlove는 Reed-iOS 프로젝트에서 테스트/데모용 코드와 프로덕션 코드에 대해 다른 코드 품질 기준을 적용한다. 테스트용 뷰에서는 안전성 검증 등의 엄격한 코드 품질 요구사항을 적용하지 않는 것을 선호한다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:124-133
Timestamp: 2025-07-10T08:21:49.399Z
Learning: doyeonk429는 테스트 전용으로만 사용되는 extension이나 코드는 해당 테스트 파일에 그대로 두는 것을 선호합니다. 실제 프로덕션 코드에서 사용되지 않는 테스트 전용 코드는 별도 파일로 분리하지 않고 테스트 파일 내에 유지하는 것이 그들의 코드 구성 방식입니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:38-48
Timestamp: 2025-07-08T17:17:40.046Z
Learning: doyeonk429는 BKDesign 프로젝트에서 다크모드 지원 코드를 미래를 위한 사전 준비 코드로 구현하고 있다. 현재 다크모드 디자인이 없어서 모든 다크모드 분기에서 라이트모드 색상을 반환하도록 의도적으로 구현했으며, 나중에 다크모드 디자인이 완성되면 해당 케이스만 구현하면 되는 구조로 설계했다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:0-0
Timestamp: 2025-07-10T08:21:44.204Z
Learning: doyeonk429는 BKDesign PreviewApp의 테스트 파일에서 주석 처리된 코드를 의도적으로 남겨두어 쉽게 테스트 구성을 전환할 수 있도록 구현한다. 이는 개발 편의성을 위한 것으로, 테스트 파일에서는 일반적인 "주석 처리된 코드 제거" 규칙을 적용하지 않는다.
src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift (1)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (3)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKDimView.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/BKDesign/PreviewApp/Sources/View/BottomSheetTitleViewController.swift (1)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (1)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetContent.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleStyle.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (1)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetProtocol.swift (1)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
🧬 Code Graph Analysis (2)
src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (1)
src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift (1)
  • configure (55-73)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetProtocol.swift (1)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (1)
  • show (138-140)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (6)
src/Projects/BKDesign/PreviewApp/Sources/View/BottomSheetTitleViewController.swift (1)

5-10: 테스트용 뷰 컨트롤러 구현이 적절합니다.

간단하고 명확한 구현으로 바텀시트 타이틀 스타일을 테스트하는 목적에 잘 부합합니다.

src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift (1)

53-56: 바텀시트 통합을 위한 패딩 추가가 적절합니다.

BKSpacing을 사용한 일관된 여백 설정으로 바텀시트 내에서 버튼 그룹이 더 자연스럽게 표시될 것 같습니다.

src/Projects/BKDesign/Sources/Components/BottomSheet/BKDimView.swift (1)

8-13: 딤 뷰 초기화 로직이 잘 구현되었습니다.

alpha 값을 파라미터로 받아 투명도를 조절할 수 있고, 탭 제스처를 통한 인터랙션도 적절히 구현되었습니다.

src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleStyle.swift (1)

5-21: 바텀시트 타이틀 스타일 enum이 잘 설계되었습니다.

각 케이스가 명확하게 구분되고, associated values를 통해 필요한 데이터를 효율적으로 전달할 수 있도록 설계되었습니다. 한국어 주석도 이해하기 쉽게 작성되었습니다.

src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (1)

11-22: 스택뷰 설정이 적절합니다.

세로 배치와 적절한 스페이싱으로 각 타이틀 스타일을 명확하게 구분할 수 있도록 잘 구성되었습니다.

src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetProtocol.swift (1)

5-21: 프로토콜 설계가 적절합니다

바텀시트 인터페이스가 명확하게 정의되어 있고, 높이 설정을 위한 enum도 잘 구성되었습니다.

Comment thread src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift Outdated
@clxxrlove clxxrlove marked this pull request as draft July 13, 2025 07:23
@clxxrlove clxxrlove marked this pull request as ready for review July 14, 2025 05:15
Copy link
Copy Markdown

@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

🧹 Nitpick comments (3)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (1)

64-64: 하드코딩된 높이값 개선 고려

여러 곳에서 높이값이 24로 하드코딩되어 있습니다. 디자인 시스템의 상수를 사용하거나 동적 계산을 고려해보세요.

-            $0.height.equalTo(24)
+            $0.height.equalTo(BKTextStyle.heading2(weight: .semiBold).lineHeight)

Also applies to: 74-74, 97-97, 103-103

src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (2)

104-104: 중복 할당 제거 필요

dimView = dim이 두 번 할당되고 있습니다.

     }
-    
-    dimView = dim
     setupPresentationController()

131-136: 배경색 중복 설정

setup() 메서드(113라인)와 configure() 메서드에서 배경색이 다르게 설정되고 있습니다.

 func configure() {
-    view.backgroundColor = .white
+    // 배경색은 setup()에서 이미 설정됨
     
     modalPresentationStyle = .pageSheet
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bec742e and 212a603.

📒 Files selected for processing (14)
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTestMenuViewController.swift (1 hunks)
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (1 hunks)
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleViewController.swift (1 hunks)
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonGroupDemoViewController.swift (1 hunks)
  • src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift (5 hunks)
  • src/Projects/BKDesign/Sources/Components/BKSearchTextField.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetStyle.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/Button/BKButton.swift (3 hunks)
  • src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BKInset.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BKRadius.swift (1 hunks)
  • src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingCell.swift (1 hunks)
  • src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingView.swift (1 hunks)
✅ Files skipped from review due to trivial changes (7)
  • src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BKRadius.swift
  • src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingCell.swift
  • src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingView.swift
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetStyle.swift
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonGroupDemoViewController.swift
  • src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BKInset.swift
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleViewController.swift
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#69
File: src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift:57-70
Timestamp: 2025-07-10T14:01:04.933Z
Learning: clxxrlove는 Reed-iOS 프로젝트에서 테스트/데모용 코드와 프로덕션 코드에 대해 다른 코드 품질 기준을 적용한다. 테스트용 뷰에서는 안전성 검증 등의 엄격한 코드 품질 요구사항을 적용하지 않는 것을 선호한다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:124-133
Timestamp: 2025-07-10T08:21:49.399Z
Learning: doyeonk429는 테스트 전용으로만 사용되는 extension이나 코드는 해당 테스트 파일에 그대로 두는 것을 선호합니다. 실제 프로덕션 코드에서 사용되지 않는 테스트 전용 코드는 별도 파일로 분리하지 않고 테스트 파일 내에 유지하는 것이 그들의 코드 구성 방식입니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:38-48
Timestamp: 2025-07-08T17:17:40.046Z
Learning: doyeonk429는 BKDesign 프로젝트에서 다크모드 지원 코드를 미래를 위한 사전 준비 코드로 구현하고 있다. 현재 다크모드 디자인이 없어서 모든 다크모드 분기에서 라이트모드 색상을 반환하도록 의도적으로 구현했으며, 나중에 다크모드 디자인이 완성되면 해당 케이스만 구현하면 되는 구조로 설계했다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:0-0
Timestamp: 2025-07-10T08:21:44.204Z
Learning: doyeonk429는 BKDesign PreviewApp의 테스트 파일에서 주석 처리된 코드를 의도적으로 남겨두어 쉽게 테스트 구성을 전환할 수 있도록 구현한다. 이는 개발 편의성을 위한 것으로, 테스트 파일에서는 일반적인 "주석 처리된 코드 제거" 규칙을 적용하지 않는다.
src/Projects/BKDesign/Sources/Components/Button/BKButton.swift (1)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
src/Projects/BKDesign/Sources/Components/BKSearchTextField.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTestMenuViewController.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (2)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
🧬 Code Graph Analysis (1)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (2)
src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (1)
  • configure (24-49)
src/Projects/BKDesign/Sources/Extensions/UIColor+.swift (1)
  • bkContentColor (52-63)
🔇 Additional comments (12)
src/Projects/BKDesign/Sources/Components/Button/BKButton.swift (3)

146-154: LGTM! 코드 일관성 개선

SnapKit 제약조건 클로저에서 단축 인수 이름 $0 사용으로 코드 일관성이 개선되었습니다. 제약조건 로직은 그대로 유지되어 기능에 영향이 없습니다.


169-175: LGTM! 아이콘 뷰 제약조건 스타일 일관성 개선

leftIconView와 rightIconView의 제약조건 설정에서 단축 인수 이름 사용으로 코드 스타일이 일관되게 개선되었습니다.


223-228: LGTM! 아이콘 크기 업데이트 로직 스타일 개선

아이콘 크기 업데이트 제약조건에서도 동일한 스타일 개선이 적용되어 전체 파일의 코드 일관성이 향상되었습니다.

src/Projects/BKDesign/Sources/Components/BKSearchTextField.swift (2)

68-68: 디자인 시스템 일관성 개선

검색 버튼의 trailing 제약 조건에서 BKInset.inset3에서 BKInset.inset4로 변경된 것은 디자인 시스템의 의미론적 명명 규칙을 개선하는 좋은 변화입니다. 실제 간격 값은 동일하게 유지되면서 더 명확한 의미를 가진 상수를 사용하게 되었습니다.


76-78: 텍스트 인셋 업데이트가 적절함

텍스트 인셋에서 inset3inset4, inset4inset11로의 변경이 일관성 있게 적용되었습니다. 좌측과 우측 인셋 모두 실제 간격 값은 유지하면서 더 의미론적인 상수명을 사용하도록 개선되었습니다. 이는 디자인 시스템 전반의 리팩토링과 일치하는 변화로 보입니다.

src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTitleTestView.swift (1)

7-50: 테스트 뷰 구현이 잘 되어 있습니다.

다양한 BottomSheet 타이틀 스타일(centered/leadingCloseButton)과 subtitle 유무에 대한 테스트 케이스가 체계적으로 구성되어 있어 개발 및 검증에 유용합니다.

src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (2)

6-32: 컴포넌트 구조가 잘 설계되었습니다.

두 가지 스타일을 깔끔하게 지원하는 구조로 설계되어 있고, 초기화 패턴도 적절합니다.


90-105: Centered 레이아웃 구현이 효율적입니다.

UIStackView를 사용한 중앙 정렬 레이아웃이 간단하고 명확하게 구현되어 있습니다.

src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTestMenuViewController.swift (1)

52-69: 테스트 UI 구성이 깔끔합니다.

다양한 BottomSheet 테스트 케이스에 대한 버튼들이 체계적으로 구성되어 있습니다.

src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (3)

6-40: BottomSheet 컴포넌트 설계가 잘 되어 있습니다.

다양한 스타일과 컨텐츠를 지원하는 유연한 구조로 설계되어 있고, 초기화 패라미터도 적절합니다.


58-79: 동적 크기 계산 로직이 개선되었습니다.

이전 리뷰에서 지적된 하드코딩된 높이값 문제가 해결되어 동적으로 preferredContentSize를 계산하고 있습니다.


210-221: Presentation Controller 설정이 적절합니다.

동적 detent와 코너 반지름 설정이 잘 구현되어 있어 다양한 디바이스에서 적응적으로 동작할 것으로 보입니다.

Copy link
Copy Markdown
Member Author

@doyeonk429 doyeonk429 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
Copy Markdown

@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

🧹 Nitpick comments (3)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (3)

29-33: 스타일 매핑 로직을 간소화할 수 있습니다.

현재 스타일 매핑이 약간 중복적입니다. BKBottomSheetStyle과 BKBottomSheetTitleView.Style이 동일한 케이스를 가진다면 직접 전달하는 것을 고려해보세요.

self.titleView = BKBottomSheetTitleView(
-    style: style == .leadingCloseButton ? .leadingCloseButton : .centered,
+    style: BKBottomSheetTitleView.Style(bottomSheetStyle: style),
    title: title,
    subtitle: subtitle
)

58-79: 성능 최적화: 불필요한 재계산을 방지하세요.

viewWillLayoutSubviews에서 매번 preferredContentSize를 계산하는 것은 비효율적입니다. 콘텐츠가 변경되지 않았다면 재계산을 건너뛰도록 개선하세요.

+ private var lastCalculatedSize: CGSize?
+ private var hasContentChanged = true

public override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews()
+   
+   guard hasContentChanged else { return }
    
    view.layoutIfNeeded()
    // ... 기존 계산 로직 ...
    
    preferredContentSize = CGSize(
        width: view.bounds.width,
        height: totalHeight
    )
+   
+   lastCalculatedSize = preferredContentSize
+   hasContentChanged = false
}

240-245: 상수 위치 개선을 고려해보세요.

LayoutConstants가 잘 정의되어 있습니다. 다만 buttonGroupHeight같은 값은 다른 컴포넌트에서도 재사용될 가능성이 있으니, 디자인 시스템의 공통 상수 파일로 이동하는 것을 고려해보세요.

예를 들어:

// BKDesign의 공통 상수 파일에 추가
public enum BKBottomSheet {
    public static let buttonAreaHeight: CGFloat = 84
    public static let dimViewAlpha: CGFloat = 0.5
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 212a603 and d9f6872.

📒 Files selected for processing (3)
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTestMenuViewController.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTestMenuViewController.swift
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#80
File: src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift:148-148
Timestamp: 2025-07-14T05:23:04.893Z
Learning: Reed-iOS 프로젝트의 BKBottomSheetViewController에서 버튼 영역 높이(84)는 디자인 시스템에 기반한 의도적인 고정값입니다. clxxrlove에 따르면 작은 기기에서도 동일한 크기가 유지되어야 하며, 동적 계산보다는 상수화만 필요합니다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#69
File: src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift:57-70
Timestamp: 2025-07-10T14:01:04.933Z
Learning: clxxrlove는 Reed-iOS 프로젝트에서 테스트/데모용 코드와 프로덕션 코드에 대해 다른 코드 품질 기준을 적용한다. 테스트용 뷰에서는 안전성 검증 등의 엄격한 코드 품질 요구사항을 적용하지 않는 것을 선호한다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:124-133
Timestamp: 2025-07-10T08:21:49.399Z
Learning: doyeonk429는 테스트 전용으로만 사용되는 extension이나 코드는 해당 테스트 파일에 그대로 두는 것을 선호합니다. 실제 프로덕션 코드에서 사용되지 않는 테스트 전용 코드는 별도 파일로 분리하지 않고 테스트 파일 내에 유지하는 것이 그들의 코드 구성 방식입니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:38-48
Timestamp: 2025-07-08T17:17:40.046Z
Learning: doyeonk429는 BKDesign 프로젝트에서 다크모드 지원 코드를 미래를 위한 사전 준비 코드로 구현하고 있다. 현재 다크모드 디자인이 없어서 모든 다크모드 분기에서 라이트모드 색상을 반환하도록 의도적으로 구현했으며, 나중에 다크모드 디자인이 완성되면 해당 케이스만 구현하면 되는 구조로 설계했다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:0-0
Timestamp: 2025-07-10T08:21:44.204Z
Learning: doyeonk429는 BKDesign PreviewApp의 테스트 파일에서 주석 처리된 코드를 의도적으로 남겨두어 쉽게 테스트 구성을 전환할 수 있도록 구현한다. 이는 개발 편의성을 위한 것으로, 테스트 파일에서는 일반적인 "주석 처리된 코드 제거" 규칙을 적용하지 않는다.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (6)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#80
File: src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift:148-148
Timestamp: 2025-07-14T05:23:04.893Z
Learning: Reed-iOS 프로젝트의 BKBottomSheetViewController에서 버튼 영역 높이(84)는 디자인 시스템에 기반한 의도적인 고정값입니다. clxxrlove에 따르면 작은 기기에서도 동일한 크기가 유지되어야 하며, 동적 계산보다는 상수화만 필요합니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#69
File: src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift:57-70
Timestamp: 2025-07-10T14:01:04.933Z
Learning: clxxrlove는 Reed-iOS 프로젝트에서 테스트/데모용 코드와 프로덕션 코드에 대해 다른 코드 품질 기준을 적용한다. 테스트용 뷰에서는 안전성 검증 등의 엄격한 코드 품질 요구사항을 적용하지 않는 것을 선호한다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:0-0
Timestamp: 2025-07-10T08:21:44.204Z
Learning: doyeonk429는 BKDesign PreviewApp의 테스트 파일에서 주석 처리된 코드를 의도적으로 남겨두어 쉽게 테스트 구성을 전환할 수 있도록 구현한다. 이는 개발 편의성을 위한 것으로, 테스트 파일에서는 일반적인 "주석 처리된 코드 제거" 규칙을 적용하지 않는다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#69
File: src/Projects/BKDesign/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json:1-35
Timestamp: 2025-07-10T13:26:07.554Z
Learning: clxxrlove는 Reed-iOS 프로젝트에서 AppIcon 에셋 구조를 미리 설정하고, 실제 이미지 파일이 준비되기 전까지는 filename 속성을 의도적으로 생략하는 개발 방식을 사용한다. 이는 에셋 구조를 먼저 만들고 나중에 이미지를 추가하는 단계적 개발 접근법이다.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (2)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (2)

6-18: 클래스 구조와 프로퍼티 정의가 잘 되어 있습니다.

final class 사용으로 상속을 방지하고, 프로퍼티들이 적절히 캡슐화되어 있습니다.


1-246: 전반적으로 잘 구현된 바텀시트 컴포넌트입니다.

코드가 잘 구조화되어 있고, 이전 리뷰에서 지적된 상수화 요청들이 적절히 반영되었습니다. 스타일별 분기 처리와 애니메이션 로직도 깔끔하게 구현되어 있습니다.

@clxxrlove clxxrlove force-pushed the BOOK-115-feature/#65 branch from d9f6872 to d15ae6a Compare July 14, 2025 05:42
@clxxrlove clxxrlove force-pushed the BOOK-115-feature/#65 branch from d15ae6a to 13acf6c Compare July 14, 2025 05:43
Copy link
Copy Markdown

@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 (2)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (2)

227-233: 콘텐츠 비율 계산 로직의 확장성 개선을 고려해보세요

현재 calculateRatioIfNeeded 메서드는 UIImageView에만 특화되어 있습니다. 향후 다른 타입의 콘텐츠에서도 aspect ratio가 필요할 수 있으니 더 범용적인 접근을 고려해보세요.

protocol AspectRatioProviding {
    var aspectRatio: CGFloat? { get }
}

extension UIImageView: AspectRatioProviding {
    var aspectRatio: CGFloat? {
        guard let image = image else { return nil }
        return image.size.height / image.size.width
    }
}

func calculateRatioIfNeeded() {
    if let ratioProvider = suppliedContent as? AspectRatioProviding {
        contentAspectRatio = ratioProvider.aspectRatio
        if let imageView = suppliedContent as? UIImageView {
            imageView.contentMode = .scaleAspectFit
        }
    }
}

58-79: 레이아웃 계산 로직의 가독성 개선을 제안합니다

viewWillLayoutSubviews의 높이 계산 로직이 복잡합니다. 별도 메서드로 추출하여 가독성을 높이는 것을 고려해보세요.

public override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews()
    view.layoutIfNeeded()
    
    preferredContentSize = calculatePreferredContentSize()
}

private func calculatePreferredContentSize() -> CGSize {
    let targetWidth = rootStack.bounds.width
    let fittingSize = rootStack.systemLayoutSizeFitting(
        CGSize(width: targetWidth, height: UIView.layoutFittingCompressedSize.height),
        withHorizontalFittingPriority: .required,
        verticalFittingPriority: .fittingSizeLevel
    )
    
    let buttonHeight = button?.frame.height ?? .zero
    let totalHeight = fittingSize.height + buttonHeight + BKSpacing.spacing5
    
    return CGSize(width: view.bounds.width, height: totalHeight)
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9f6872 and 13acf6c.

📒 Files selected for processing (3)
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTestMenuViewController.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift (1 hunks)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetTitleView.swift
  • src/Projects/BKDesign/PreviewApp/Sources/View/BKBottomSheetTestMenuViewController.swift
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#80
File: src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift:148-148
Timestamp: 2025-07-14T05:23:04.893Z
Learning: Reed-iOS 프로젝트의 BKBottomSheetViewController에서 버튼 영역 높이(84)는 디자인 시스템에 기반한 의도적인 고정값입니다. clxxrlove에 따르면 작은 기기에서도 동일한 크기가 유지되어야 하며, 동적 계산보다는 상수화만 필요합니다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#69
File: src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift:57-70
Timestamp: 2025-07-10T14:01:04.933Z
Learning: clxxrlove는 Reed-iOS 프로젝트에서 테스트/데모용 코드와 프로덕션 코드에 대해 다른 코드 품질 기준을 적용한다. 테스트용 뷰에서는 안전성 검증 등의 엄격한 코드 품질 요구사항을 적용하지 않는 것을 선호한다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:124-133
Timestamp: 2025-07-10T08:21:49.399Z
Learning: doyeonk429는 테스트 전용으로만 사용되는 extension이나 코드는 해당 테스트 파일에 그대로 두는 것을 선호합니다. 실제 프로덕션 코드에서 사용되지 않는 테스트 전용 코드는 별도 파일로 분리하지 않고 테스트 파일 내에 유지하는 것이 그들의 코드 구성 방식입니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:38-48
Timestamp: 2025-07-08T17:17:40.046Z
Learning: doyeonk429는 BKDesign 프로젝트에서 다크모드 지원 코드를 미래를 위한 사전 준비 코드로 구현하고 있다. 현재 다크모드 디자인이 없어서 모든 다크모드 분기에서 라이트모드 색상을 반환하도록 의도적으로 구현했으며, 나중에 다크모드 디자인이 완성되면 해당 케이스만 구현하면 되는 구조로 설계했다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:0-0
Timestamp: 2025-07-10T08:21:44.204Z
Learning: doyeonk429는 BKDesign PreviewApp의 테스트 파일에서 주석 처리된 코드를 의도적으로 남겨두어 쉽게 테스트 구성을 전환할 수 있도록 구현한다. 이는 개발 편의성을 위한 것으로, 테스트 파일에서는 일반적인 "주석 처리된 코드 제거" 규칙을 적용하지 않는다.
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (7)
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Foundation/GraphicSystem/BottomSheetShadow.swift:5-10
Timestamp: 2025-07-08T17:16:15.942Z
Learning: doyeonk429는 BottomSheetShadow struct에서 apply(to:)와 asCALayerShadow() 메서드를 처음에 만들었지만 활용 측면에서 애매할 것 같아서 제외했다고 함. 정적 속성만으로 구현하는 것을 선호함.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#80
File: src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift:148-148
Timestamp: 2025-07-14T05:23:04.893Z
Learning: Reed-iOS 프로젝트의 BKBottomSheetViewController에서 버튼 영역 높이(84)는 디자인 시스템에 기반한 의도적인 고정값입니다. clxxrlove에 따르면 작은 기기에서도 동일한 크기가 유지되어야 하며, 동적 계산보다는 상수화만 필요합니다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/Sources/Components/Button/BKButtonGroup.swift:86-92
Timestamp: 2025-07-10T08:21:16.126Z
Learning: BKButtonGroup의 horizontal 레이아웃에서 stackView.distribution을 .fillProportionally로 설정한 것은 의도된 디자인입니다. doyeonk429는 버튼들이 콘텐츠 길이에 따라 다른 너비를 가지는 것을 선호합니다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#69
File: src/Projects/BKDesign/PreviewApp/Sources/View/CatalogViewController.swift:57-70
Timestamp: 2025-07-10T14:01:04.933Z
Learning: clxxrlove는 Reed-iOS 프로젝트에서 테스트/데모용 코드와 프로덕션 코드에 대해 다른 코드 품질 기준을 적용한다. 테스트용 뷰에서는 안전성 검증 등의 엄격한 코드 품질 요구사항을 적용하지 않는 것을 선호한다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#68
File: src/Projects/BKDesign/PreviewApp/Sources/View/BKButtonTestViewController.swift:0-0
Timestamp: 2025-07-10T08:21:44.204Z
Learning: doyeonk429는 BKDesign PreviewApp의 테스트 파일에서 주석 처리된 코드를 의도적으로 남겨두어 쉽게 테스트 구성을 전환할 수 있도록 구현한다. 이는 개발 편의성을 위한 것으로, 테스트 파일에서는 일반적인 "주석 처리된 코드 제거" 규칙을 적용하지 않는다.
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#69
File: src/Projects/BKDesign/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json:1-35
Timestamp: 2025-07-10T13:26:07.554Z
Learning: clxxrlove는 Reed-iOS 프로젝트에서 AppIcon 에셋 구조를 미리 설정하고, 실제 이미지 파일이 준비되기 전까지는 filename 속성을 의도적으로 생략하는 개발 방식을 사용한다. 이는 에셋 구조를 먼저 만들고 나중에 이미지를 추가하는 단계적 개발 접근법이다.
Learnt from: doyeonk429
PR: YAPP-Github/Reed-iOS#63
File: src/Projects/BKDesign/Sources/Extensions/UIColor+.swift:50-92
Timestamp: 2025-07-08T17:17:37.703Z
Learning: BKDesign 프로젝트에서 UIColor+ 확장의 시맨틱 컬러 메서드들(.bkContentColor, .bkBorderColor, .bkDividerColor, .bkBaseColor)이 현재 다크 모드에서도 라이트 모드 색상을 반환하는 것은 의도적인 구현입니다. 아직 다크 모드가 구현되지 않았지만, 미래의 다크 모드 지원을 위한 코드 구조로 준비되어 있습니다.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (3)
src/Projects/BKDesign/Sources/Components/BottomSheet/BKBottomSheetViewController.swift (3)

236-241: 상수 정의가 잘 되어 있습니다!

이전 리뷰에서 제기된 하드코딩된 높이값 문제가 LayoutConstants를 통해 잘 해결되었습니다. 디자인 시스템의 의도에 맞게 고정값을 상수로 관리하는 것이 올바른 접근입니다.


111-111: 배경색 설정이 개선되었습니다

이전 리뷰에서 제기된 배경색 일관성 문제가 .bkBaseColor(.primary) 사용으로 해결되어 디자인 시스템과 일관성을 유지하고 있습니다.


86-106: dimView 중복 할당 문제가 해결되었습니다

이전 리뷰에서 지적된 dimView 중복 할당 문제가 깔끔하게 해결되어 불필요한 코드 중복이 제거되었습니다.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-115/feat] BottomSheet 컴포넌트 개발

2 participants