-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#93 다운타임 모달뷰 구현 #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8924198
e962602
941e2b3
9738fdb
16f0bcb
4527b98
54c6e5a
044087c
aae7aaa
27a7246
d91ad6e
035d309
1aa4587
3462c7e
213b94e
69d5358
6d83d44
ca57c92
bca5de7
07419eb
5bd8c20
bd01f3d
f91aaba
d103644
211614f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,10 @@ | |
| import SwiftUI | ||
|
|
||
| struct DownTimeSettingView: View { | ||
| @State var selectedTreatment: TreatmentEntity? = nil | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Optional 변수를 Swift에서 Optional 타입은 기본값이 ♻️ 제안된 수정- `@State` var selectedTreatment: TreatmentEntity? = nil
+ `@State` var selectedTreatment: TreatmentEntity?🧰 Tools🪛 SwiftLint (0.57.0)[Warning] 11-11: Initializing an optional variable with nil is redundant (redundant_optional_initialization) 🤖 Prompt for AI Agents |
||
| var treatments: [TreatmentEntity] | ||
|
|
||
| let setday: (year: Int, month: Int, day: Int) | ||
| let today: (year: Int, month: Int, day: Int) | ||
|
Comment on lines
+11
to
+14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 프라이빗 붙이면 좋을 것 같습니다! |
||
| var body: some View { | ||
| VStack { | ||
| Spacer() | ||
|
|
@@ -27,7 +29,19 @@ struct DownTimeSettingView: View { | |
| } | ||
| ScrollView(.vertical, showsIndicators: false) { | ||
| ForEach(treatments, id: \.self) { treatment in | ||
| TreatmentRowView(displayMode: .completeBoxView, treatmentEntity: treatment, isSelected: .constant(false), isCompleted: .constant(false), action: {}) | ||
| TreatmentRowView( | ||
| displayMode: .completeBoxView, | ||
| treatmentEntity: treatment, | ||
| isSelected: .constant( | ||
| selectedTreatment == treatment | ||
| ), | ||
| isCompleted: .constant( | ||
| false | ||
| ), | ||
| action: { | ||
| selectedTreatment = treatment | ||
|
|
||
| }) | ||
|
Comment on lines
+32
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -type f -name "DownTimeSettingView.swift" | head -5Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 174 🏁 Script executed: cat -n ./Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/DownTimeSettingView.swiftRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 3800 🏁 Script executed: find . -type f -name "*.swift" | xargs rg "struct TreatmentRowView" -lRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 161 🏁 Script executed: cat -n ./Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/Treatment/TreatmentRowView.swiftRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 6911 읽기 전용 Binding으로 인해 토글 시 런타임 경고 유발
🛠️ 제안 수정- isSelected: .constant(
- selectedTreatment == treatment
- ),
+ isSelected: Binding(
+ get: { selectedTreatment == treatment },
+ set: { newValue in
+ selectedTreatment = newValue ? treatment : nil
+ }
+ ),🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| Spacer() | ||
|
|
@@ -64,9 +78,18 @@ struct DownTimeSettingView: View { | |
| Spacer() | ||
| } | ||
| } | ||
|
|
||
| } | ||
| .padding(.horizontal, 25.adjustedW) | ||
| .sheet(item: $selectedTreatment) { treatment in | ||
| DowntimeBottomSheetView( | ||
| treatment: treatment, | ||
| today: today, | ||
| setday: setday | ||
| ) | ||
| .presentationDetents([.extraLarge]) | ||
| .presentationBackground(.gray0) | ||
| .presentationDragIndicator(.visible) | ||
| } | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,13 +8,17 @@ | |||||||||||||||||||||||||||||||||
| import SwiftUI | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| struct DowntimeBottomSheetView: View { | ||||||||||||||||||||||||||||||||||
| @State var selectedDowntime: Int = 5 | ||||||||||||||||||||||||||||||||||
| @State var rate: Double = 0.5 | ||||||||||||||||||||||||||||||||||
| let treatment: TreatmentEntity | ||||||||||||||||||||||||||||||||||
| let today: (year: Int, month: Int, day: Int) | ||||||||||||||||||||||||||||||||||
| let setday: (year: Int, month: Int, day: Int) | ||||||||||||||||||||||||||||||||||
| @State private var selectedDowntime: Int = 1 | ||||||||||||||||||||||||||||||||||
| @State private var rate: Double = 0.0 | ||||||||||||||||||||||||||||||||||
| @State private var betweenDays: Int = 0 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| var body: some View { | ||||||||||||||||||||||||||||||||||
| VStack(spacing: 0) { | ||||||||||||||||||||||||||||||||||
| Spacer() | ||||||||||||||||||||||||||||||||||
| .frame(height: 25.adjustedH) | ||||||||||||||||||||||||||||||||||
| .frame(height: 35.adjustedH) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| TypographyText("개인 다운타임으로 설정해주세요.", style: .title1_sb_18, color: .gray1000) | ||||||||||||||||||||||||||||||||||
| .frame(height: 27.adjustedH) | ||||||||||||||||||||||||||||||||||
|
|
@@ -34,25 +38,52 @@ struct DowntimeBottomSheetView: View { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| grayLineView | ||||||||||||||||||||||||||||||||||
| .padding(.horizontal, 25.adjustedW) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| pickerView | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| grayLineView | ||||||||||||||||||||||||||||||||||
| .padding(.horizontal, 25.adjustedW) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Spacer() | ||||||||||||||||||||||||||||||||||
| .frame(height: 44.adjustedH) | ||||||||||||||||||||||||||||||||||
| buttonView | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| .onAppear { | ||||||||||||||||||||||||||||||||||
| selectedDowntime = treatment.downtimeMax | ||||||||||||||||||||||||||||||||||
| betweenDays = Date.daysBetween(from: setday, to: today) ?? 0 | ||||||||||||||||||||||||||||||||||
| rate = betweenDays > 0 ? min(Double(selectedDowntime) / Double(betweenDays), 1.0) : 1.0 | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| .onChange(of: selectedDowntime) { | ||||||||||||||||||||||||||||||||||
| rate = betweenDays > 0 ? min(Double(selectedDowntime) / Double(betweenDays), 1.0) : 1.0 | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+52
to
59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's locate and examine the CherrishPicker component
fd -t f CherrishPickerRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 196 🏁 Script executed: # Also find the Treatment model to check downtimeMax constraints
fd -t f TreatmentRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 2047 🏁 Script executed: # Let's examine the full DowntimeBottomSheetView file
fd -t f DowntimeBottomSheetViewRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 176 🏁 Script executed: # Examine the DowntimeBottomSheetView file
cat -n "Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/DowntimeBottomSheetView.swift"Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 8107 🏁 Script executed: # Search for CherrishPicker definition
rg "struct CherrishPicker|class CherrishPicker" -t swift -A 20Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 2366 🏁 Script executed: # Examine Treatment model
cat -n "Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Treatment/Model/Treatment.swift"Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 1674 🏁 Script executed: # Search for TreatmentEntity definition
cat -n "Cherrish-iOS/Cherrish-iOS/Domain/Model/TreatmentEntity.swift"Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 3569 🏁 Script executed: # Also search for CherrishPicker full implementation
cat -n "Cherrish-iOS/Cherrish-iOS/Presentation/Global/Components/CherrishPicker.swift"Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 3984 초기 선택값이 피커 범위를 벗어날 수 있습니다.
🛠️ 제안 수정- selectedDowntime = treatment.downtimeMax
+ selectedDowntime = min(max(treatment.downtimeMax, 1), 30)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| extension DowntimeBottomSheetView { | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| private var speechBubble: some View { | ||||||||||||||||||||||||||||||||||
| ZStack { | ||||||||||||||||||||||||||||||||||
| Image(.speechBubble) | ||||||||||||||||||||||||||||||||||
| .resizable() | ||||||||||||||||||||||||||||||||||
| .scaledToFill() | ||||||||||||||||||||||||||||||||||
| .frame(height: 53.adjustedH) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| TypographyText("회복 목표디데이로부터 약 7일 전에 안정될 수 있어요.", style: .body1_r_14, color: .gray1000) | ||||||||||||||||||||||||||||||||||
| Group { | ||||||||||||||||||||||||||||||||||
| if betweenDays - selectedDowntime < 1 { | ||||||||||||||||||||||||||||||||||
| TypographyText( | ||||||||||||||||||||||||||||||||||
| "설정한 다운타임은 목표일을 넘깁니다.", | ||||||||||||||||||||||||||||||||||
| style: .body1_r_14, | ||||||||||||||||||||||||||||||||||
| color: .gray1000 | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||
| TypographyText( | ||||||||||||||||||||||||||||||||||
| "회복 목표디데이로부터 약 \(betweenDays - selectedDowntime)일 전에 안정될 수 있어요.", | ||||||||||||||||||||||||||||||||||
| style: .body1_r_14, | ||||||||||||||||||||||||||||||||||
| color: .gray1000 | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| .lineLimit(1) | ||||||||||||||||||||||||||||||||||
| .minimumScaleFactor(0.8) | ||||||||||||||||||||||||||||||||||
| .padding(.horizontal, 18.adjustedW) | ||||||||||||||||||||||||||||||||||
|
|
@@ -72,8 +103,7 @@ extension DowntimeBottomSheetView { | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Spacer () | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| TypographyText("여유기간 7일", style: .title2_m_16, color: .gray800) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| TypographyText("여유기간 \(betweenDays - selectedDowntime < 0 ? 0 : betweenDays - selectedDowntime)일", style: .title2_m_16, color: .gray800) | ||||||||||||||||||||||||||||||||||
| Spacer() | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -96,12 +126,12 @@ extension DowntimeBottomSheetView { | |||||||||||||||||||||||||||||||||
| .padding(.horizontal, 25.adjustedW) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| HStack { | ||||||||||||||||||||||||||||||||||
| TypographyText("1월 2일", style: .body2_r_13, color: .gray700) | ||||||||||||||||||||||||||||||||||
| TypographyText("\(today.month)월 \(today.day)일", style: .body2_r_13, color: .gray700) | ||||||||||||||||||||||||||||||||||
| .frame(height: 18.adjustedH) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Spacer() | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| TypographyText("1월 14일", style: .body2_r_13, color: .gray700) | ||||||||||||||||||||||||||||||||||
| TypographyText("\(setday.month)월 \(setday.day)일", style: .body2_r_13, color: .gray700) | ||||||||||||||||||||||||||||||||||
| .frame(height: 18.adjustedH) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| .padding(.horizontal, 25.adjustedW) | ||||||||||||||||||||||||||||||||||
|
|
@@ -119,10 +149,19 @@ extension DowntimeBottomSheetView { | |||||||||||||||||||||||||||||||||
| Spacer() | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| VStack(spacing: 0) { | ||||||||||||||||||||||||||||||||||
| TypographyText("다운타임", style: .headline_sb_20, color: .gray1000) | ||||||||||||||||||||||||||||||||||
| TypographyText( | ||||||||||||||||||||||||||||||||||
| "다운타임", | ||||||||||||||||||||||||||||||||||
| style: .headline_sb_20, | ||||||||||||||||||||||||||||||||||
| color: .gray1000 | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| .frame(height: 30.adjustedH) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| TypographyText("보통 3-5일", style: .title2_m_16, color: .gray600) | ||||||||||||||||||||||||||||||||||
| TypographyText( | ||||||||||||||||||||||||||||||||||
| "보통 \(treatment.downtimeMin)-\(treatment.downtimeMax)일", | ||||||||||||||||||||||||||||||||||
| style: .title2_m_16, | ||||||||||||||||||||||||||||||||||
| color: .gray600 | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
| .frame(height: 24.adjustedH) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Spacer() | ||||||||||||||||||||||||||||||||||
|
|
@@ -132,4 +171,37 @@ extension DowntimeBottomSheetView { | |||||||||||||||||||||||||||||||||
| Spacer() | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| private var buttonView: some View { | ||||||||||||||||||||||||||||||||||
| GeometryReader { geo in | ||||||||||||||||||||||||||||||||||
| HStack(spacing: 4.adjustedW) { | ||||||||||||||||||||||||||||||||||
| CherrishButton( | ||||||||||||||||||||||||||||||||||
| title: "다운타임 없이 일정 추가", | ||||||||||||||||||||||||||||||||||
| type: .addEvent, | ||||||||||||||||||||||||||||||||||
| state: .constant( | ||||||||||||||||||||||||||||||||||
| .normal | ||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||
| leadingIcon: .none, | ||||||||||||||||||||||||||||||||||
| trailingIcon: .none, | ||||||||||||||||||||||||||||||||||
| action: { }) | ||||||||||||||||||||||||||||||||||
| .frame(width: geo.size.width * 2/3 - 2) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| CherrishButton( | ||||||||||||||||||||||||||||||||||
| title: "확인", | ||||||||||||||||||||||||||||||||||
| type: .small, | ||||||||||||||||||||||||||||||||||
| state: .constant( | ||||||||||||||||||||||||||||||||||
| .normal | ||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||
| leadingIcon: .none, | ||||||||||||||||||||||||||||||||||
| trailingIcon: .none, | ||||||||||||||||||||||||||||||||||
| action: { }) | ||||||||||||||||||||||||||||||||||
| .frame( | ||||||||||||||||||||||||||||||||||
| width: geo.size.width * 1/3 - 2 | ||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| .frame(height: 50.adjustedH) | ||||||||||||||||||||||||||||||||||
| .padding(.horizontal, 24.adjustedW) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
175
to
206
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -name "DowntimeBottomSheetView.swift" -type fRepository: TEAM-Cherrish/Cherrish-iOS Length of output: 178 🏁 Script executed: cat -n "Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/DowntimeBottomSheetView.swift" | sed -n '130,160p'Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 1143 🏁 Script executed: cat -n "Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/DowntimeBottomSheetView.swift" | grep -A 20 "buttonView"Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 1650 🏁 Script executed: wc -l "Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/DowntimeBottomSheetView.swift"Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 180 🏁 Script executed: cat -n "Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Calendar/Treatment/Components/DowntimeBottomSheetView.swift" | sed -n '1,50p'Repository: TEAM-Cherrish/Cherrish-iOS Length of output: 1650 GeometryReader 폭 계산이 외부 패딩을 고려하지 않아 오버플로우 위험
🛠️ 제안 변경 private var buttonView: some View {
GeometryReader { geo in
+ let total = geo.size.width - 48.adjustedW
HStack(spacing: 4.adjustedW) {
CherrishButton(title: "다운타임 없이 일정 추가", type: .addEvent, state: .constant(.normal), leadingIcon: .none, trailingIcon: .none, action: {})
- .frame(width: geo.size.width * 2/3 - 2)
+ .frame(width: total * 2/3 - 2)
CherrishButton(title: "확인", type: .small, state: .constant(.normal), leadingIcon: .none, trailingIcon: .none, action: {})
- .frame(width: geo.size.width * 1/3 - 2)
+ .frame(width: total * 1/3 - 2)
}
+ .padding(.horizontal, 24.adjustedW)
}
- .padding(.horizontal, 24.adjustedW)
}🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,67 +30,70 @@ struct TargetDdaySettingView: View { | |
| @Binding var day: String | ||
|
|
||
| var body: some View { | ||
| VStack { | ||
| Spacer() | ||
| .frame(height: 50.adjustedH) | ||
|
|
||
| HStack(spacing:0){ | ||
| VStack(alignment: .leading, spacing: 0) { | ||
| TypographyText("회복을 계획할 때 고려해야 할", style: .title1_sb_18, color: .gray1000) | ||
|
|
||
| TypographyText("중요한 일정이 있나요?", style: .title1_sb_18, color: .gray1000) | ||
| ScrollView(.vertical, showsIndicators: false) { | ||
| VStack { | ||
| Spacer() | ||
| .frame(height: 50.adjustedH) | ||
|
|
||
| HStack(spacing:0){ | ||
| VStack(alignment: .leading, spacing: 0) { | ||
| TypographyText("회복을 계획할 때 고려해야 할", style: .title1_sb_18, color: .gray1000) | ||
|
|
||
| TypographyText("중요한 일정이 있나요?", style: .title1_sb_18, color: .gray1000) | ||
|
|
||
| } | ||
|
|
||
| Spacer() | ||
| } | ||
| .frame(height: 54.adjustedH) | ||
|
|
||
| Spacer() | ||
| } | ||
| .frame(height: 54.adjustedH) | ||
|
|
||
| Spacer() | ||
| .frame(height: 40) | ||
|
|
||
| HStack(spacing: 12.adjustedW) { | ||
| ForEach(DdayState.allCases, id: \.self) { state in | ||
| SelectionChip( | ||
| title: state.title, | ||
| isSelected: Binding( | ||
| get: { | ||
| dDayState == state | ||
| }, | ||
| set: {isSelected in | ||
| guard isSelected else { | ||
| return | ||
| .frame(height: 40) | ||
|
|
||
| HStack(spacing: 12.adjustedW) { | ||
| ForEach(DdayState.allCases, id: \.self) { state in | ||
| SelectionChip( | ||
| title: state.title, | ||
| isSelected: Binding( | ||
| get: { | ||
| dDayState == state | ||
| }, | ||
| set: {isSelected in | ||
| guard isSelected else { | ||
| return | ||
| } | ||
| dDayState = state | ||
| } | ||
| dDayState = state | ||
| } | ||
| ) | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Spacer() | ||
| .frame(height: 56.adjustedH) | ||
|
|
||
| if let state = dDayState { | ||
| HStack(spacing: 0) { | ||
| switch state { | ||
|
|
||
| Spacer() | ||
| .frame(height: 56.adjustedH) | ||
|
|
||
| if let state = dDayState { | ||
| HStack(spacing: 0) { | ||
| switch state { | ||
| case .yes: | ||
| TypographyText("언제까지 회복이 완료되면 좋을까요?", style: .title1_sb_18, color: .gray1000) | ||
| TypographyText("언제까지 회복이 완료되면 좋을까요?", style: .title1_sb_18, color: .gray1000) | ||
| case .no: | ||
| TypographyText("대략적인 회복 목표일을 정해볼까요?", style: .title1_sb_18, color: .gray1000) | ||
| TypographyText("대략적인 회복 목표일을 정해볼까요?", style: .title1_sb_18, color: .gray1000) | ||
|
Comment on lines
+79
to
+81
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 프레임 한번만 주세요 |
||
| } | ||
|
|
||
| Spacer() | ||
|
|
||
| } | ||
| .frame(height: 27.adjustedH) | ||
|
|
||
| Spacer() | ||
| .frame(height: 24.adjustedH) | ||
|
|
||
| DateTextBox(year: $year, month: $month, day: $day) | ||
| } | ||
|
|
||
| Spacer() | ||
| .frame(height: 24.adjustedH) | ||
|
|
||
| DateTextBox(year: $year, month: $month, day: $day) | ||
|
|
||
| } | ||
| } | ||
| .scrollDismissesKeyboard(.interactively) | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self를id로 사용하면 속성 변경 시 SwiftUI가 아이템 동일성을 잃을 수 있습니다.var id: Self { self }는 모든 속성이 동일해야 같은 아이템으로 인식됩니다. 속성이 변경되면 SwiftUI가 이를 새 아이템으로 간주하여 리스트 애니메이션이나 상태 유지에 문제가 발생할 수 있습니다.안정적인 식별자(예:
UUID또는 고유한name)를 사용하는 것이 권장됩니다.🛠️ 제안된 수정
또는
name이 고유하다면:🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id도 self 쓰나용??