Skip to content

Commit 42e9809

Browse files
authored
[#508] regular ui일 때는 뷰 배경색을 통일하도록 수정한다 (#518)
* refactor: NavigationBarConfigurator 기본 배경 통일 * refactor: TodoDetail 배경 통일 * refactor: TodoEditor 배경 통일 * refactor: TodoList 배경 통일 * refactor: MainView detail 배경 통일 * refactor: PushNotificationList 배경 통일 * refactor: RootView 시트 배경 통일 * fix: iOS 18 이하 버전에서 safeArea 부분의 배경색 수정
1 parent 24c1921 commit 42e9809

8 files changed

Lines changed: 19 additions & 17 deletions

File tree

Application/DevLogPresentation/Sources/Common/NavigationBarConfigurator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import DevLogDomain
1010

1111
/// NavigationBar의 배경색을 지정하고 shadowColor를 제거하는 구조체
1212
///
13-
/// 기본적으로 ``UIColor/systemBackground``를 배경색으로 사용하며,
13+
/// 기본적으로 ``UIColor/systemGroupedBackground``를 배경색으로 사용하며,
1414
/// 자체 `NavigationStack`을 가진 뷰에서는 `alwaysVisible`을 `true`로 설정하여
1515
/// 스크롤 위치와 관계없이 배경색이 항상 표시되도록 할 수 있다.
1616
struct NavigationBarConfigurator: UIViewControllerRepresentable {
@@ -20,7 +20,7 @@ struct NavigationBarConfigurator: UIViewControllerRepresentable {
2020
/// 지정된 배경색으로 Configurator를 생성한다.
2121
///
2222
/// - Parameter backgroundColor: NavigationBar에 적용할 배경색.
23-
init(_ backgroundColor: UIColor = .systemBackground) {
23+
init(_ backgroundColor: UIColor = .systemGroupedBackground) {
2424
self.backgroundColor = backgroundColor
2525
self.alwaysVisible = false
2626
}
@@ -32,7 +32,7 @@ struct NavigationBarConfigurator: UIViewControllerRepresentable {
3232
/// - alwaysVisible: `true`이면 스크롤 위치와 관계없이 배경색이 항상 표시된다.
3333
/// 자체 `NavigationStack`을 가진 뷰에서 사용한다.
3434
@available(iOS, deprecated: 18, message: "iOS 18 이상에서는 alwaysVisible 파라미터가 없는 생성자를 사용한다.")
35-
init(_ backgroundColor: UIColor = .systemBackground, alwaysVisible: Bool) {
35+
init(_ backgroundColor: UIColor = .systemGroupedBackground, alwaysVisible: Bool) {
3636
self.backgroundColor = backgroundColor
3737
if #available(iOS 18.0, *) {
3838
self.alwaysVisible = false

Application/DevLogPresentation/Sources/Common/TodoDetailContentView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct TodoDetailContentView: View {
1818

1919
var body: some View {
2020
ZStack {
21-
Color(.secondarySystemBackground).ignoresSafeArea()
21+
Color(.systemGroupedBackground).ignoresSafeArea()
2222
ScrollView {
2323
LazyVStack(alignment: .leading, spacing: 10) {
2424
HStack(alignment: .firstTextBaseline, spacing: 8) {

Application/DevLogPresentation/Sources/Home/TodoDetailView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct TodoDetailView: View {
1717

1818
var body: some View {
1919
ZStack {
20-
Color(.secondarySystemBackground).ignoresSafeArea()
20+
Color(.systemGroupedBackground).ignoresSafeArea()
2121
if let todo = viewModel.state.todo, let number = todo.number {
2222
TodoDetailContentView(
2323
title: todo.title,
@@ -55,7 +55,7 @@ struct TodoDetailView: View {
5555
}
5656
}
5757
}
58-
.background(Color(.secondarySystemBackground))
58+
.background(Color(.systemGroupedBackground))
5959
.presentationDragIndicator(.visible)
6060
}
6161
.fullScreenCover(isPresented: Binding(

Application/DevLogPresentation/Sources/Home/TodoEditorView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct TodoEditorView: View {
7373
}
7474
}
7575
}
76-
.background(Color(.secondarySystemBackground))
76+
.background(Color(.systemGroupedBackground))
7777
.presentationDragIndicator(.visible)
7878
}
7979
.toolbar {

Application/DevLogPresentation/Sources/Home/TodoListView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ struct TodoListView: View {
116116
}
117117
}
118118
.background(NavigationBarConfigurator())
119+
.background(Color(.systemGroupedBackground))
119120
.task { viewModel.send(.onAppear) }
120121
}
121122

@@ -201,7 +202,7 @@ struct TodoListView: View {
201202
if #available(iOS 26.0, *) {
202203
Color.clear
203204
} else {
204-
Color(.systemBackground)
205+
Color(.systemGroupedBackground)
205206
}
206207
}
207208
.offset(y: headerOffset)

Application/DevLogPresentation/Sources/Main/MainView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ struct MainView: View {
152152
}
153153
}
154154
}
155-
.background(Color(.secondarySystemBackground).ignoresSafeArea())
155+
.background(Color(.systemGroupedBackground).ignoresSafeArea())
156156
case .profile:
157157
NavigationSplitView {
158158
mainSidebar
@@ -236,7 +236,7 @@ struct MainView: View {
236236
homeDestinationView(homeRoute)
237237
}
238238
}
239-
.background(Color(.secondarySystemBackground).ignoresSafeArea())
239+
.background(Color(.systemGroupedBackground).ignoresSafeArea())
240240
}
241241

242242
@ViewBuilder
@@ -304,7 +304,7 @@ struct MainView: View {
304304
todayDestinationView(todayRoute)
305305
}
306306
}
307-
.background(Color(.secondarySystemBackground).ignoresSafeArea())
307+
.background(Color(.systemGroupedBackground).ignoresSafeArea())
308308
}
309309

310310
@ViewBuilder
@@ -349,7 +349,7 @@ struct MainView: View {
349349
profileRegularDestinationView(route)
350350
}
351351
}
352-
.background(Color(.secondarySystemBackground).ignoresSafeArea())
352+
.background(Color(.systemGroupedBackground).ignoresSafeArea())
353353
}
354354

355355
@ViewBuilder

Application/DevLogPresentation/Sources/PushNotification/PushNotificationListView.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ struct PushNotificationListView: View {
2525
var body: some View {
2626
NavigationStack {
2727
notificationList
28-
.background(NavigationBarConfigurator(.secondarySystemBackground, alwaysVisible: true))
28+
.background(Color(.systemGroupedBackground))
29+
.background(NavigationBarConfigurator(alwaysVisible: true))
2930
.onScrollOffsetChange { offset in
3031
guard isScrollTrackingEnabled else { return }
3132
headerOffset = max(0, -offset)
@@ -35,7 +36,7 @@ struct PushNotificationListView: View {
3536
.navigationTitle(String(localized: "nav_push_notifications"))
3637
.listStyle(.plain)
3738
}
38-
.background(Color(.secondarySystemBackground).ignoresSafeArea())
39+
.background(Color(.systemGroupedBackground).ignoresSafeArea())
3940
.alert(
4041
"",
4142
isPresented: Binding(
@@ -75,7 +76,7 @@ struct PushNotificationListView: View {
7576
}
7677
}
7778
}
78-
.background(Color(.secondarySystemBackground))
79+
.background(Color(.systemGroupedBackground))
7980
.presentationDragIndicator(.visible)
8081
}
8182
.overlay {
@@ -167,7 +168,7 @@ struct PushNotificationListView: View {
167168
if #available(iOS 26.0, *) {
168169
Color.clear
169170
} else {
170-
Color(.secondarySystemBackground)
171+
Color(.systemGroupedBackground)
171172
}
172173
}
173174
.offset(y: headerOffset)

Application/DevLogPresentation/Sources/Root/RootView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public struct RootView: View {
104104
}
105105
}
106106
}
107-
.background(Color(.secondarySystemBackground))
107+
.background(Color(.systemGroupedBackground))
108108
.presentationDragIndicator(.visible)
109109
}
110110
}

0 commit comments

Comments
 (0)