Skip to content

Comments

Feat/#29 TextBox 구현#55

Merged
wotjs020708 merged 18 commits intodevelopfrom
feat/#29-textbox
Jan 14, 2026
Merged

Feat/#29 TextBox 구현#55
wotjs020708 merged 18 commits intodevelopfrom
feat/#29-textbox

Conversation

@wotjs020708
Copy link
Contributor

🔗 연결된 이슈

📄 작업 내용

  • TextBox 컴포넌트 구현
스크린샷 2026-01-13 22 57 20
구현 내용 IPhone 16 pro IPhone 13 mini
GIF

💻 주요 코드 설명

DateTextField.swift

  • enum을 활용
enum DateTextFieldStyle: String {
    case year = "YYYY"
    case month = "MM"
    case day = "DD"
    
    var kr: String {
        switch self {
        case .year:
            ""
        case .month:
            ""
        case.day:
            ""
        }
    }
}
  • 사용방법
            CherrishTextBox(title: "나이",text: $text, placeholder: "20 세")
            DateTextBox(year: $year, month: $month, day: $day)

👀 기타 더 이야기해볼 점

두 개의 컴포넌트가 크게 변경되는 부분은 없지만 폰트랑 크기 부분이 조금씩 달라 두개를 만들었습니다.

@wotjs020708 wotjs020708 requested a review from a team January 13, 2026 14:52
@wotjs020708 wotjs020708 self-assigned this Jan 13, 2026
@wotjs020708 wotjs020708 requested review from soseoyo12, sum130 and y-eonee and removed request for a team January 13, 2026 14:52
@wotjs020708 wotjs020708 added 재선🐻 Feature 새로운 기능 구현 및 API 연결 labels Jan 13, 2026
@wotjs020708 wotjs020708 linked an issue Jan 13, 2026 that may be closed by this pull request
2 tasks
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

새로운 SwiftUI 입력 컴포넌트 세 개를 추가합니다: 스타일 가능한 기본 텍스트 필드 CherrishTextField, 제목 포함 래퍼 CherrishTextBox, 연/월/일 분리 입력을 제공하는 DateTextBox.

Changes

Cohort / File(s) 변경 요약
기본 텍스트 필드 컴포넌트
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift
CherrishTextField 추가. plain/date 스타일, 플레이스홀더 처리, 숫자 키보드(.numberPad), 스타일별 폰트/정렬/패딩/높이(44pt) 및 라운디드 테두리 적용
텍스트 박스 래퍼
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift
CherrishTextBox 추가. 제목 라벨과 내부 CherrishTextField를 포함하는 수직 레이아웃 구성
날짜 전용 입력 컴포넌트
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift
DateTextBox 추가. year/month/day 바인딩 문자열 3개와 헤더 라벨, 각 필드를 렌더링하는 내부 DateLabel 서브뷰 포함

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

성용👶

Suggested reviewers

  • sum130
  • y-eonee
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 TextBox 구현이라는 주요 변경사항을 명확하게 설명하고 있으며, 풀 리퀘스트의 핵심 내용을 잘 요약하고 있습니다.
Description check ✅ Passed 설명은 구현된 TextBox 컴포넌트, 사용 예시, 핵심 코드 설명, 그리고 스크린샷을 포함하여 변경사항과 관련된 명확한 정보를 제공합니다.
Linked Issues check ✅ Passed 풀 리퀘스트는 #29 이슈의 모든 주요 요구사항을 충족합니다: 연도/월/일 입력이 있는 날짜 텍스트 필드(DateTextBox)와 나이 텍스트 필드(CherrishTextBox)가 모두 구현되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항은 #29 이슈의 범위 내에 있으며, 날짜 텍스트 필드와 나이 텍스트 필드 구현에 필요한 컴포넌트들만 추가되었습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/#29-textbox

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: 5

🤖 Fix all issues with AI agents
In
@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/AgeTextBox.swift:
- Around line 20-21: Replace the explicit vertical spacer Spacer().frame(height:
8.adjustedH) with the VStack's spacing parameter: remove the Spacer().frame(...)
call and set the parent VStack (the one containing AgeTextBox elements) to
spacing: 8.adjustedH so layout is handled by the stack; update any VStack
initializers that wrap the affected views (look for usages of VStack { ... }
around AgeTextBox and the Spacer()) to include spacing and remove the explicit
Spacer() line.

In
@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift:
- Around line 23-27: The HStack containing the three DateLabel views currently
omits an explicit spacing value; update that HStack to specify the intended
spacing (e.g., HStack(spacing: 0)) to match the earlier HStack usage and make
layout intent explicit so DateLabel(text: $year, ...), DateLabel(text: $month,
...), and DateLabel(text: $day, ...) render with the correct spacing.

In
@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/AgeTextField.swift:
- Line 29: The code uses the deprecated SwiftUI modifier accentColor (seen as
.accentColor(.gray1000)) in AgeTextField.swift; replace that call with the
modern .tint(.gray1000) modifier on the same view chain (i.e., change
.accentColor(.gray1000) to .tint(.gray1000)) so the view uses the supported tint
API instead of the deprecated accentColor.

In
@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift:
- Line 21: Switch 구문에서 "case.day"처럼 붙어있는 케이스 레이블의 공백이 빠져 있습니다;
DateTextField.swift의 해당 switch 내부에서 "case.day"를 찾아 "case .day"처럼 case와 .day 사이에
공백을 추가해 코드 스타일을 일관되게 맞춰 주세요 (식별자: case .day).
- Around line 42-45: In DateTextField.swift update the style chain to match
AgeTextField: replace .foregroundStyle(.gray1000) with the extension call
.gray1000() and replace the deprecated .accentColor(.gray1000) with
.tint(.gray1000), keeping the existing .multilineTextAlignment(.center) and
.typography(.title2_m_16) in the same chain so the visual styling is consistent
and uses non-deprecated APIs.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 822c9c8 and 9dae48f.

📒 Files selected for processing (4)
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/AgeTextBox.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/AgeTextField.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift
🧰 Additional context used
🧬 Code graph analysis (3)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/AgeTextField.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (3)
  • gray600 (33-35)
  • gray1000 (49-51)
  • gray500 (29-31)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Font+.swift (1)
  • typography (60-65)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (2)
  • gray500 (29-31)
  • gray1000 (49-51)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Font+.swift (1)
  • typography (60-65)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
  • body (9-17)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (2)
  • gray1000 (49-51)
  • gray700 (37-39)
🔇 Additional comments (6)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/AgeTextField.swift (2)

33-34: padding 적용 방향 확인 필요

adjustedH가 horizontal padding에, adjustedW가 vertical padding에 사용되고 있습니다. 일반적으로 H는 높이(height), W는 너비(width)를 의미하므로 의도한 대로인지 확인이 필요합니다.


10-42: 전반적인 구현이 잘 되어 있습니다.

ZStack을 활용한 placeholder 패턴, 숫자 키보드 설정, 그리고 일관된 스타일링이 적절하게 적용되어 있습니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/AgeTextBox.swift (1)

10-25: LGTM!

AgeTextBox 컴포넌트가 AgeTextField를 적절히 구성하고 있으며, 레이아웃 구조가 명확합니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift (1)

10-25: DateTextFieldStyle enum 구현이 잘 되어 있습니다.

rawValue와 kr 속성을 통해 placeholder와 한글 레이블을 깔끔하게 제공하고 있습니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift (2)

33-42: DateLabel 서브뷰 구현이 깔끔합니다.

DateTextField와 한글 접미사를 조합하여 재사용 가능한 private 컴포넌트로 잘 분리되어 있습니다. fileprivate 접근 제어자 사용도 적절합니다.


12-31: LGTM!

DateTextBox 컴포넌트가 년/월/일 입력을 위한 세 개의 바인딩을 적절히 관리하고 있으며, DateLabel을 통해 코드 중복을 효과적으로 줄였습니다.

Comment on lines +20 to +21
Spacer()
.frame(height: 8.adjustedH)
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Spacer().frame(height:) 대신 VStack spacing 활용 고려

현재 Spacer().frame(height: 8.adjustedH)를 사용하고 있지만, VStack의 spacing을 8.adjustedH로 설정하면 더 간결해집니다.

♻️ 제안 코드
-        VStack(spacing: 0) {
+        VStack(spacing: 8.adjustedH) {
             HStack(spacing: 0) {
                 TypographyText("나이", style: .body1_sb_14,color: .gray1000)
                 Spacer()
             }
-            Spacer()
-                .frame(height: 8.adjustedH)
             AgeTextField(text: $text, placeholder: placeholder)
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Spacer()
.frame(height: 8.adjustedH)
VStack(spacing: 8.adjustedH) {
HStack(spacing: 0) {
TypographyText("나이", style: .body1_sb_14,color: .gray1000)
Spacer()
}
AgeTextField(text: $text, placeholder: placeholder)
}
🤖 Prompt for AI Agents
In
@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/AgeTextBox.swift
around lines 20 - 21, Replace the explicit vertical spacer
Spacer().frame(height: 8.adjustedH) with the VStack's spacing parameter: remove
the Spacer().frame(...) call and set the parent VStack (the one containing
AgeTextBox elements) to spacing: 8.adjustedH so layout is handled by the stack;
update any VStack initializers that wrap the affected views (look for usages of
VStack { ... } around AgeTextBox and the Spacer()) to include spacing and remove
the explicit Spacer() line.

Comment on lines +23 to +27
HStack{
DateLabel(text: $year, placeholderStyle: .year)
DateLabel(text: $month, placeholderStyle: .month)
DateLabel(text: $day, placeholderStyle: .day)
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

HStack spacing 명시적 지정 권장

Line 19의 HStack(spacing: 0)과 달리 Line 23의 HStack은 spacing이 지정되어 있지 않습니다. 의도적으로 기본 spacing을 사용하는 것이라면 괜찮지만, 명시적으로 지정하면 레이아웃 의도가 더 명확해집니다.

🤖 Prompt for AI Agents
In
@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift
around lines 23 - 27, The HStack containing the three DateLabel views currently
omits an explicit spacing value; update that HStack to specify the intended
spacing (e.g., HStack(spacing: 0)) to match the earlier HStack usage and make
layout intent explicit so DateLabel(text: $year, ...), DateLabel(text: $month,
...), and DateLabel(text: $day, ...) render with the correct spacing.

.multilineTextAlignment(.leading)
.keyboardType(.numberPad)
.typography(.body1_m_14)
.accentColor(.gray1000)
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

accentColor는 iOS 15부터 deprecated되었습니다.

accentColor(_:)는 더 이상 권장되지 않으며, tint(_:) modifier를 사용하는 것이 좋습니다.

♻️ 권장 수정 사항
-                    .accentColor(.gray1000)
+                    .tint(Color("gray_1000"))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.accentColor(.gray1000)
.tint(.gray1000)
🤖 Prompt for AI Agents
In
@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/AgeTextField.swift
at line 29, The code uses the deprecated SwiftUI modifier accentColor (seen as
.accentColor(.gray1000)) in AgeTextField.swift; replace that call with the
modern .tint(.gray1000) modifier on the same view chain (i.e., change
.accentColor(.gray1000) to .tint(.gray1000)) so the view uses the supported tint
API instead of the deprecated accentColor.

Copy link
Contributor

Choose a reason for hiding this comment

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

tint! 사용해보세요 deprecated 된 거는 수정해주는 게 좋을 것 같아요~~

Copy link
Contributor

@soseoyo12 soseoyo12 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~

Comment on lines 60 to 62
#Preview {
DateTextField(text: Binding.constant(""), placeholder: .year)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

프리뷰 삭제부탁드려영

Copy link
Contributor

@y-eonee y-eonee left a comment

Choose a reason for hiding this comment

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

폰트나 다른 디테일이 조금 다르더라도 enum으로 나눌 수 있다고 생각합니다 ~

enum CherrishTextFieldType {  
    case default
    case number 
    var 폰트 ~~ { } 
|

이런식으로 다시 리팩토링해보는 것은 어떨까요

Comment on lines 9 to 11



Copy link
Contributor

Choose a reason for hiding this comment

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

줄바꿈 삭제해주세요 !

Comment on lines 12 to 14
let placeholder: String
var body: some View {

Copy link
Contributor

Choose a reason for hiding this comment

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

요기 엔터처리가 좀 이상한듯

Comment on lines 60 to 62
#Preview {
DateTextField(text: Binding.constant(""), placeholder: .year)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

프리뷰 삭제~

Copy link
Contributor

@sum130 sum130 left a comment

Choose a reason for hiding this comment

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

deprecated된 것 수정하면 좋을 것 같아용 수고했어용!!

.multilineTextAlignment(.leading)
.keyboardType(.numberPad)
.typography(.body1_m_14)
.accentColor(.gray1000)
Copy link
Contributor

Choose a reason for hiding this comment

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

tint! 사용해보세요 deprecated 된 거는 수정해주는 게 좋을 것 같아요~~

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: 4

🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift`:
- Around line 1-6: Header filename and actual struct name mismatch: the top
comment shows "AgeTextBox.swift" while the struct is CherrishTextBox. Fix by
either renaming the file header to "CherrishTextBox.swift" (update the top
comment block) to match the struct CherrishTextBox, or if the intent was an
AgeTextBox type, rename the struct CherrishTextBox to AgeTextBox (and update any
references). Locate the comment block at the top of the file and the struct
declaration named CherrishTextBox to apply the change consistently.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`:
- Around line 1-6: The file header comment lists "AgeTextField.swift" but the
struct defined is CherrishTextField; update the header comment to match the
actual file/struct name (e.g., change the header to "CherrishTextField.swift")
or rename the struct to match the intended filename—ensure consistency between
the header filename and the struct name CherrishTextField so they match exactly.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift`:
- Line 45: The code in DateTextField.swift uses direct Color assets
(.tint(.gray1000) and .stroke(.gray500, ...)) which mismatches the project's
color extension; replace those direct asset references with the color extension
helpers (use the View+Color.swift methods, e.g. call gray1000() and gray500()
from the extension) so update .tint(.gray1000) to .tint(.gray1000()) and
.stroke(.gray500, ...) to .stroke(.gray500(), ...) (or the exact extension API
names) for consistency.
- Around line 41-46: The TextField in DateTextField.swift allows unlimited
numeric input (TextField("" ,text: $text) with .keyboardType(.numberPad));
enforce length limits for year (4 chars) and month/day (2 chars) by trimming
user input in an onChange/onReceive handler tied to the bound state ($text)
inside the DateTextField view: detect the current date segment (e.g., year vs
month/day based on cursor/format) or apply segment-specific max lengths and
truncate excess characters, updating the bound variable and preventing
non-numeric characters if needed; modify the TextField usage to attach the
onChange/onReceive logic that enforces those max lengths and numeric-only input.
♻️ Duplicate comments (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift (1)

21-22: Spacer().frame(height:) 대신 VStack spacing 활용 고려

이전 리뷰에서 지적된 사항입니다. VStack의 spacing을 8.adjustedH로 설정하면 코드가 더 간결해집니다.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9dae48f and 4f90b9f.

📒 Files selected for processing (3)
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift
🧰 Additional context used
🧬 Code graph analysis (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
  • body (9-17)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (1)
  • gray1000 (49-51)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift (3)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
  • body (9-17)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (2)
  • gray500 (29-31)
  • gray1000 (49-51)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Font+.swift (1)
  • typography (60-65)
🔇 Additional comments (5)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (2)

33-34: adjustedH와 adjustedW 사용이 반대로 되어 있을 가능성

일반적으로 adjustedH는 높이 기반 조정, adjustedW는 너비 기반 조정에 사용됩니다. 현재 .padding(.horizontal, 16.adjustedH).padding(.vertical, 10.adjustedW) 사용이 반대로 적용된 것으로 보입니다.

의도된 동작인지 확인해 주세요. 만약 반대라면:

♻️ 수정 제안
-        .padding(.horizontal, 16.adjustedH)
-        .padding(.vertical, 10.adjustedW)
+        .padding(.horizontal, 16.adjustedW)
+        .padding(.vertical, 10.adjustedH)

15-30: 플레이스홀더 오버레이 패턴 적용 - LGTM

ZStack을 사용한 커스텀 플레이스홀더 구현이 적절합니다. text.isEmpty 조건으로 플레이스홀더 표시/숨김을 제어하고, 스타일링도 일관성 있게 적용되어 있습니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift (1)

10-24: 컴포넌트 구성 - LGTM

CherrishTextBoxtitle, text 바인딩, placeholder를 받아 라벨과 CherrishTextField를 조합하는 구조가 적절합니다. 재사용 가능한 컴포넌트로 잘 설계되었습니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift (2)

10-25: LGTM!

Enum 구현이 올바르며 kr computed property가 각 날짜 스타일에 맞는 한글 접미사를 잘 반환합니다.


50-51: Padding adjustment 네이밍 확인 필요

.padding(.horizontal, 18.5.adjustedH).padding(.vertical, 8.adjustedW)에서 adjustedH(Height)가 horizontal에, adjustedW(Width)가 vertical에 사용되고 있습니다. 의도된 것인지 확인해 주세요.

일반적으로 horizontal padding은 width 기준, vertical padding은 height 기준으로 조정하는 것이 자연스럽습니다.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +1 to +6
//
// AgeTextBox.swift
// Cherrish-iOS
//
// Created by 어재선 on 1/13/26.
//
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

파일 헤더의 파일명과 실제 struct 이름 불일치

헤더에는 AgeTextBox.swift로 되어 있지만 실제 struct 이름은 CherrishTextBox입니다.

🔧 수정 제안
 //
-//  AgeTextBox.swift
+//  CherrishTextBox.swift
 //  Cherrish-iOS
 //
 //  Created by 어재선 on 1/13/26.
 //
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//
// AgeTextBox.swift
// Cherrish-iOS
//
// Created by 어재선 on 1/13/26.
//
//
// CherrishTextBox.swift
// Cherrish-iOS
//
// Created by 어재선 on 1/13/26.
//
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift`
around lines 1 - 6, Header filename and actual struct name mismatch: the top
comment shows "AgeTextBox.swift" while the struct is CherrishTextBox. Fix by
either renaming the file header to "CherrishTextBox.swift" (update the top
comment block) to match the struct CherrishTextBox, or if the intent was an
AgeTextBox type, rename the struct CherrishTextBox to AgeTextBox (and update any
references). Locate the comment block at the top of the file and the struct
declaration named CherrishTextBox to apply the change consistently.

Comment on lines +1 to +6
//
// AgeTextField.swift
// Cherrish-iOS
//
// Created by 어재선 on 1/13/26.
//
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

파일 헤더의 파일명과 실제 struct 이름 불일치

헤더에는 AgeTextField.swift로 되어 있지만 실제 struct 이름은 CherrishTextField입니다. 파일명 변경 시 헤더 주석도 함께 업데이트가 필요합니다.

🔧 수정 제안
 //
-//  AgeTextField.swift
+//  CherrishTextField.swift
 //  Cherrish-iOS
 //
 //  Created by 어재선 on 1/13/26.
 //
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
//
// AgeTextField.swift
// Cherrish-iOS
//
// Created by 어재선 on 1/13/26.
//
//
// CherrishTextField.swift
// Cherrish-iOS
//
// Created by 어재선 on 1/13/26.
//
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`
around lines 1 - 6, The file header comment lists "AgeTextField.swift" but the
struct defined is CherrishTextField; update the header comment to match the
actual file/struct name (e.g., change the header to "CherrishTextField.swift")
or rename the struct to match the intended filename—ensure consistency between
the header filename and the struct name CherrishTextField so they match exactly.

Comment on lines 41 to 46
TextField("" ,text: $text)
.gray1000()
.multilineTextAlignment(.center)
.typography(.title2_m_16)
.tint(.gray1000)
.keyboardType(.numberPad)
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

날짜 입력 길이 제한 고려

현재 숫자 키보드만 설정되어 있지만, 입력 길이 제한이 없습니다. year는 4자리, month/day는 2자리로 제한하면 잘못된 입력을 방지할 수 있습니다.

♻️ onChange를 활용한 입력 제한 예시
                 TextField("" ,text: $text)
                     .gray1000()
                     .multilineTextAlignment(.center)
                     .typography(.title2_m_16)
                     .tint(Color("gray_1000"))
                     .keyboardType(.numberPad)
+                    .onChange(of: text) { _, newValue in
+                        let maxLength = placeholder == .year ? 4 : 2
+                        if newValue.count > maxLength {
+                            text = String(newValue.prefix(maxLength))
+                        }
+                    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TextField("" ,text: $text)
.gray1000()
.multilineTextAlignment(.center)
.typography(.title2_m_16)
.tint(.gray1000)
.keyboardType(.numberPad)
TextField("" ,text: $text)
.gray1000()
.multilineTextAlignment(.center)
.typography(.title2_m_16)
.tint(.gray1000)
.keyboardType(.numberPad)
.onChange(of: text) { _, newValue in
let maxLength = placeholder == .year ? 4 : 2
if newValue.count > maxLength {
text = String(newValue.prefix(maxLength))
}
}
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift`
around lines 41 - 46, The TextField in DateTextField.swift allows unlimited
numeric input (TextField("" ,text: $text) with .keyboardType(.numberPad));
enforce length limits for year (4 chars) and month/day (2 chars) by trimming
user input in an onChange/onReceive handler tied to the bound state ($text)
inside the DateTextField view: detect the current date segment (e.g., year vs
month/day based on cursor/format) or apply segment-specific max lengths and
truncate excess characters, updating the bound variable and preventing
non-numeric characters if needed; modify the TextField usage to attach the
onChange/onReceive logic that enforces those max lengths and numeric-only input.

.gray1000()
.multilineTextAlignment(.center)
.typography(.title2_m_16)
.tint(.gray1000)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

컬러 컨벤션 불일치

View+Color.swift extension에서 gray500()Color("gray_500"), gray1000()Color("gray_1000")을 사용합니다. 하지만 .tint(.gray1000).stroke(.gray500, ...)는 언더스코어 없는 Color asset을 직접 참조하고 있어 불일치가 발생할 수 있습니다.

🔧 수정 제안
                 TextField("" ,text: $text)
                     .gray1000()
                     .multilineTextAlignment(.center)
                     .typography(.title2_m_16)
-                    .tint(.gray1000)
+                    .tint(Color("gray_1000"))
                     .keyboardType(.numberPad)
         .background {
             RoundedRectangle(cornerRadius: 10)
-                .stroke(.gray500, lineWidth: 1)
+                .stroke(Color("gray_500"), lineWidth: 1)
         }

Also applies to: 54-54

🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/DateTextField.swift`
at line 45, The code in DateTextField.swift uses direct Color assets
(.tint(.gray1000) and .stroke(.gray500, ...)) which mismatches the project's
color extension; replace those direct asset references with the color extension
helpers (use the View+Color.swift methods, e.g. call gray1000() and gray500()
from the extension) so update .tint(.gray1000) to .tint(.gray1000()) and
.stroke(.gray500, ...) to .stroke(.gray500(), ...) (or the exact extension API
names) for consistency.

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

🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`:
- Around line 142-147: The TextField in CherrishTextField currently hardcodes
.keyboardType(.numberPad); update CherrishTextField to accept a configurable
keyboardType (either via the style struct used by CherrishTextField or an init
parameter) and replace the hardcoded .keyboardType call with that property
(e.g., use style.keyboardType or a keyboardType binding passed into the view).
Ensure the new keyboardType has a sensible default of .numberPad to preserve
current behavior while allowing callers to override for general text input.
- Around line 51-63: The properties textColor and fontHeight currently use
redundant switch statements with only a default branch; replace each switch by
returning the constant directly (e.g., have textColor return .gray1000 and
fontHeight return 24.adjustedH) and remove the unused switch blocks in
CherrishTextField (keep the property names textColor and fontHeight unchanged);
if you later need per-style branching, reintroduce a switch in these properties.
- Around line 90-97: Rename the misspelled property textAlinement to
textAlignment across the CherrishTextField type: update the computed property
declaration (currently var textAlinement: TextAlignment { ... }) to var
textAlignment: TextAlignment { ... } and adjust the switch cases unchanged; then
refactor every usage/site that references textAlinement (including the other
occurrence noted around the second block/line mentioned in the review) to the
new textAlignment name so all calls, bindings, and previews compile and the
spelling is consistent.
♻️ Duplicate comments (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (1)

10-10: Swift 네이밍 컨벤션 위반: 타입명은 대문자로 시작해야 합니다.

cherrishTextFieldStyle은 소문자로 시작하지만, Swift의 타입(enum, struct, class)은 UpperCamelCase를 따라야 합니다. SwiftLint에서도 이 오류를 감지했습니다.

🔧 수정 제안
-enum cherrishTextFieldStyle {
+enum CherrishTextFieldStyle {

Line 120도 함께 수정 필요:

-    let style: cherrishTextFieldStyle
+    let style: CherrishTextFieldStyle
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f90b9f and d34e475.

📒 Files selected for processing (3)
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift
🧰 Additional context used
🧬 Code graph analysis (3)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
  • body (9-17)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (1)
  • gray1000 (49-51)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (4)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (3)
  • gray600 (33-35)
  • gray500 (29-31)
  • gray1000 (49-51)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishButton.swift (1)
  • textColor (89-98)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
  • body (9-17)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Font+.swift (1)
  • typography (60-65)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
  • body (9-17)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (2)
  • gray1000 (49-51)
  • gray700 (37-39)
🪛 SwiftLint (0.57.0)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift

[Error] 10-10: Type name 'cherrishTextFieldStyle' should start with an uppercase character

(type_name)

🔇 Additional comments (4)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift (1)

12-51: 구현이 잘 되어 있습니다.

DateTextBox와 DateLabel 구조체가 깔끔하게 분리되어 있으며, CherrishTextField를 재사용하여 일관된 스타일을 유지하고 있습니다. 이전 리뷰에서 언급된 빈 줄 삭제와 HStack spacing 명시 사항만 반영하면 됩니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift (1)

10-28: 구현이 적절합니다.

CherrishTextBox 컴포넌트가 title, text binding, placeholder를 잘 캡슐화하고 있습니다. 이전 리뷰에서 언급된 파일 헤더 수정과 VStack spacing 활용 사항만 반영하면 됩니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (2)

149-157: 고정 높이와 동적 패딩 간 충돌 가능성 검토 필요

frame(height: 44)가 패딩 적용 후 하드코딩되어 있습니다. style.verticalPaddingstyle.fontHeightadjustedH를 사용하므로, 다양한 화면 크기에서 내부 콘텐츠가 44pt를 초과할 경우 레이아웃 문제가 발생할 수 있습니다.

다양한 디바이스에서 텍스트 필드가 잘리거나 레이아웃이 깨지지 않는지 확인해 주세요. 필요시 고정 높이 대신 동적 높이를 고려하거나, 고정 높이도 adjustedH를 적용하는 것을 권장합니다.


100-115: DateTextFieldStyle enum 구현이 깔끔합니다.

rawValue와 kr 프로퍼티를 통해 placeholder와 한글 라벨을 효과적으로 관리하고 있습니다.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +51 to +63
var textColor: Color {
switch self {
default:
return .gray1000
}
}

var fontHeight: CGFloat {
switch self {
default:
return 24.adjustedH
}
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

default만 있는 switch문 단순화 가능

textColor, fontHeight 등 현재 모든 케이스에서 동일한 값을 반환하는 프로퍼티들은 switch 없이 직접 값을 반환하면 더 간결해집니다.

♻️ 제안 코드
     var textColor: Color {
-        switch self {
-        default:
-            return .gray1000
-        }
+        .gray1000
     }
     
     var fontHeight: CGFloat {
-        switch self {
-        default:
-            return 24.adjustedH
-        }
+        24.adjustedH
     }

향후 스타일별 분기가 필요해지면 다시 switch로 변경하면 됩니다.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var textColor: Color {
switch self {
default:
return .gray1000
}
}
var fontHeight: CGFloat {
switch self {
default:
return 24.adjustedH
}
}
var textColor: Color {
.gray1000
}
var fontHeight: CGFloat {
24.adjustedH
}
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`
around lines 51 - 63, The properties textColor and fontHeight currently use
redundant switch statements with only a default branch; replace each switch by
returning the constant directly (e.g., have textColor return .gray1000 and
fontHeight return 24.adjustedH) and remove the unused switch blocks in
CherrishTextField (keep the property names textColor and fontHeight unchanged);
if you later need per-style branching, reintroduce a switch in these properties.

Comment on lines +90 to +97
var textAlinement: TextAlignment {
switch self {
case .plain:
return .leading
case .date:
return .center
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

오타 수정 필요: textAlinementtextAlignment

프로퍼티명에 오타가 있습니다. Alinement가 아닌 Alignment가 올바른 철자입니다.

🔧 수정 제안
-    var textAlinement: TextAlignment {
+    var textAlignment: TextAlignment {

Line 144도 함께 수정:

-                    .multilineTextAlignment(style.textAlinement)
+                    .multilineTextAlignment(style.textAlignment)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var textAlinement: TextAlignment {
switch self {
case .plain:
return .leading
case .date:
return .center
}
}
var textAlignment: TextAlignment {
switch self {
case .plain:
return .leading
case .date:
return .center
}
}
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`
around lines 90 - 97, Rename the misspelled property textAlinement to
textAlignment across the CherrishTextField type: update the computed property
declaration (currently var textAlinement: TextAlignment { ... }) to var
textAlignment: TextAlignment { ... } and adjust the switch cases unchanged; then
refactor every usage/site that references textAlinement (including the other
occurrence noted around the second block/line mentioned in the review) to the
new textAlignment name so all calls, bindings, and previews compile and the
spelling is consistent.

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

🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`:
- Around line 83-88: The computed property backgroundStrokeColor currently uses
a switch with only a default case; simplify it the same way as the earlier
property (lines 51-63) by removing the switch and directly returning .gray500
from backgroundStrokeColor to make the code concise and clear.
- Line 10: Rename the enum cherrishTextFieldStyle to follow Swift PascalCase
(CherrishTextFieldStyle) and update all references/usages (e.g., the usage
currently at the location noted around line 120) to the new name; ensure any
switch cases, associated values, initializers, type annotations, and imports
referencing cherrishTextFieldStyle are updated accordingly and rebuild to verify
no remaining references.
♻️ Duplicate comments (4)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (4)

1-6: 파일 헤더의 파일명이 실제 struct 이름과 불일치합니다.

헤더에 AgeTextField.swift로 되어 있으나 실제 struct 이름은 CherrishTextField입니다.


51-63: default만 있는 switch문은 단순화할 수 있습니다.

이전 리뷰에서 지적된 사항입니다. 직접 값을 반환하면 더 간결해집니다.


90-97: 오타: textAlinementtextAlignment

이전 리뷰에서 지적된 사항입니다. Line 144에서 사용하는 곳도 함께 수정 필요합니다.


142-147: numberPad 키보드 타입이 하드코딩되어 있습니다.

이전 리뷰에서 지적된 사항입니다. 현재 요구사항에서는 문제없지만, 향후 컴포넌트 재사용성을 위해 스타일 또는 파라미터로 분리하는 것을 고려해 주세요.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d34e475 and fd51870.

📒 Files selected for processing (1)
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift
🧰 Additional context used
🧬 Code graph analysis (1)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (3)
  • gray600 (33-35)
  • gray500 (29-31)
  • gray1000 (49-51)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/Font+.swift (1)
  • typography (60-65)
🪛 SwiftLint (0.57.0)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift

[Error] 10-10: Type name 'cherrishTextFieldStyle' should start with an uppercase character

(type_name)

🔇 Additional comments (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (2)

100-115: LGTM!

DateTextFieldStyle enum이 적절하게 구현되었습니다. 네이밍 컨벤션도 올바르고, kr computed property를 통한 한글 접미사 제공도 깔끔합니다.


118-160: 전체 구조는 적절합니다.

ZStack을 활용한 커스텀 placeholder 오버레이 패턴과 스타일 기반 속성 분기가 잘 구현되어 있습니다. 위에서 언급된 네이밍/오타 이슈들만 수정하면 됩니다.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +83 to +88
var backgroundStrokeColor: Color {
switch self {
default:
return .gray500
}
}
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

backgroundStrokeColor도 동일하게 단순화 가능합니다.

Lines 51-63과 동일한 패턴으로, default만 있는 switch문입니다.

♻️ 수정 제안
     var backgroundStrokeColor: Color {
-        switch self {
-        default:
-            return .gray500
-        }
+        .gray500
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var backgroundStrokeColor: Color {
switch self {
default:
return .gray500
}
}
var backgroundStrokeColor: Color {
.gray500
}
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`
around lines 83 - 88, The computed property backgroundStrokeColor currently uses
a switch with only a default case; simplify it the same way as the earlier
property (lines 51-63) by removing the switch and directly returning .gray500
from backgroundStrokeColor to make the code concise and clear.

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: 1

🤖 Fix all issues with AI agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`:
- Around line 141-146: The TextField call has a missing space after the opening
string comma and hardcodes .keyboardType(.numberPad); fix the formatting by
adding the space so it reads TextField("", text: $text) and make the keyboard
type configurable by replacing .keyboardType(.numberPad) with
.keyboardType(keyboardType) (or a similarly named property) on the
CherrishTextField component, add a keyboardType property with a sensible default
(e.g., .numberPad) to the component's initializer/state so callers can override
it for general text input, and update any initializers/usages to pass the
desired keyboard type.
♻️ Duplicate comments (6)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (3)

1-6: 파일 헤더의 파일명과 실제 struct 이름 불일치

헤더에는 AgeTextField.swift로 되어 있지만 실제 struct 이름은 CherrishTextField입니다. 파일명과 일치하도록 헤더 주석을 수정해 주세요.

🔧 수정 제안
 //
-//  AgeTextField.swift
+//  CherrishTextField.swift
 //  Cherrish-iOS

51-63: default만 있는 switch문 단순화 권장

textColor, fontHeight, backgroundStrokeColor 프로퍼티들이 모든 케이스에서 동일한 값을 반환합니다. switch 없이 직접 값을 반환하면 더 간결해집니다.

♻️ 수정 제안
     var textColor: Color {
-        switch self {
-        default:
-            return .gray1000
-        }
+        .gray1000
     }
     
     var fontHeight: CGFloat {
-        switch self {
-        default:
-            return 24.adjustedH
-        }
+        24.adjustedH
     }
     
     // ...
     
     var backgroundStrokeColor: Color {
-        switch self {
-        default:
-            return .gray500
-        }
+        .gray500
     }

Also applies to: 83-88


90-97: 오타 수정 필요: textAlinementtextAlignment

프로퍼티명에 오타가 있습니다. Alinement가 아닌 Alignment가 올바른 철자입니다. Line 143의 사용처도 함께 수정이 필요합니다.

🔧 수정 제안
-    var textAlinement: TextAlignment {
+    var textAlignment: TextAlignment {

Line 143도 함께 수정:

-                    .multilineTextAlignment(style.textAlinement)
+                    .multilineTextAlignment(style.textAlignment)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift (2)

1-6: 파일 헤더의 파일명과 실제 struct 이름 불일치

헤더에는 AgeTextBox.swift로 되어 있지만 실제 struct 이름은 CherrishTextBox입니다.

🔧 수정 제안
 //
-//  AgeTextBox.swift
+//  CherrishTextBox.swift
 //  Cherrish-iOS

15-24: VStack spacing 활용 및 코드 포맷팅 개선

  1. Spacer().frame(height: 8.adjustedH) 대신 VStack의 spacing 파라미터를 활용하면 더 간결해집니다.
  2. Line 18에서 style: 뒤 쉼표와 color: 사이에 공백이 누락되어 있습니다.
♻️ 수정 제안
     var body: some View {
-        VStack(spacing: 0) {
+        VStack(spacing: 8.adjustedH) {
             HStack(spacing: 0) {
-                TypographyText(title, style: .body1_sb_14,color: .gray1000)
+                TypographyText(title, style: .body1_sb_14, color: .gray1000)
                 Spacer()
             }
-            Spacer()
-                .frame(height: 8.adjustedH)
             CherrishTextField(text: $text, style: .plain(placeholder: placeholder))
         }
     }
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift (1)

21-25: HStack spacing 명시적 지정 권장

Line 17의 HStack(spacing: 0)과 달리 Line 21의 HStack은 spacing이 지정되어 있지 않습니다. 또한 { 앞에 공백이 누락되어 있습니다.

♻️ 수정 제안
-            HStack{
+            HStack(spacing: 8) {
                 DateLabel(text: $year, placeholderStyle: .year)
                 DateLabel(text: $month, placeholderStyle: .month)
                 DateLabel(text: $day, placeholderStyle: .day)
             }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd51870 and 35bb6cb.

📒 Files selected for processing (3)
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift
🧰 Additional context used
🧬 Code graph analysis (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/CherrishTextBox.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
  • body (9-17)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (1)
  • gray1000 (49-51)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift (2)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Shadow.swift (1)
  • body (9-17)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Extension/View+Color.swift (2)
  • gray1000 (49-51)
  • gray700 (37-39)
🔇 Additional comments (3)
Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift (1)

100-115: LGTM!

DateTextFieldStyle enum이 깔끔하게 구현되어 있습니다. raw value와 한글 suffix를 제공하는 kr 프로퍼티가 적절합니다.

Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextBox/DateTextBox.swift (2)

1-6: LGTM!

파일 헤더와 struct 이름이 일치합니다.


30-48: LGTM!

DateLabelprivate struct로 분리하여 캡슐화한 것이 좋습니다. CherrishTextField와 한글 suffix 라벨을 조합하는 패턴이 깔끔하게 구현되어 있습니다.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +141 to +146
TextField("" ,text: $text)
.foregroundStyle(style.textColor)
.multilineTextAlignment(style.textAlinement)
.keyboardType(.numberPad)
.typography(style.textFont)
.tint(style.textColor)
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

코드 포맷팅 개선 및 키보드 타입 하드코딩

  1. Line 141에서 쉼표 뒤에 공백이 누락되어 있습니다.
  2. .numberPad가 하드코딩되어 있어 향후 일반 텍스트 입력에 재사용할 때 제약이 됩니다.
♻️ 포맷팅 수정 제안
-                TextField("" ,text: $text)
+                TextField("", text: $text)
🤖 Prompt for AI Agents
In
`@Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishTextField/CherrishTextField.swift`
around lines 141 - 146, The TextField call has a missing space after the opening
string comma and hardcodes .keyboardType(.numberPad); fix the formatting by
adding the space so it reads TextField("", text: $text) and make the keyboard
type configurable by replacing .keyboardType(.numberPad) with
.keyboardType(keyboardType) (or a similarly named property) on the
CherrishTextField component, add a keyboardType property with a sensible default
(e.g., .numberPad) to the component's initializer/state so callers can override
it for general text input, and update any initializers/usages to pass the
desired keyboard type.

@wotjs020708 wotjs020708 merged commit b1af512 into develop Jan 14, 2026
1 check passed
@y-eonee y-eonee deleted the feat/#29-textbox branch January 15, 2026 14:39
Kimgyuilli pushed a commit that referenced this pull request Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature 새로운 기능 구현 및 API 연결 재선🐻

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 텍스트필드 제작

4 participants