Skip to content

Commit 3e4748d

Browse files
authored
[#779] iOS 18 이상에서 PushNotificationTab의 헤더가 스크롤되지 않는 현상을 해결한다 (#780)
fix: iOS 18 이상에서만 ScrollView에 들어가도록 수정
1 parent 584e282 commit 3e4748d

1 file changed

Lines changed: 24 additions & 10 deletions

File tree

Application/Presentation/NotificationTab/Sources/PushNotification/PushNotificationListView.swift

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,30 @@ public struct PushNotificationListView: View {
161161
}
162162

163163
private var headerView: some View {
164+
Group {
165+
if #available(iOS 18.0, *) {
166+
ScrollView(.horizontal) {
167+
headerContent
168+
}
169+
.scrollIndicators(.never)
170+
.contentMargins(.leading, 16, for: .scrollContent)
171+
} else {
172+
headerContent
173+
.padding(.leading, 16)
174+
}
175+
}
176+
.frame(maxWidth: .infinity, alignment: .leading)
177+
.frame(height: headerHeight)
178+
.onAppear {
179+
headerOffset = 0
180+
isScrollTrackingEnabled = false
181+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
182+
isScrollTrackingEnabled = true
183+
}
184+
}
185+
}
186+
187+
private var headerContent: some View {
164188
HStack(spacing: 8) {
165189
if 0 < store.appliedFilterCount {
166190
Menu {
@@ -231,16 +255,6 @@ public struct PushNotificationListView: View {
231255
}
232256
.frame(height: headerHeight)
233257
}
234-
.padding(.leading, 16)
235-
.frame(maxWidth: .infinity, alignment: .leading)
236-
.frame(height: headerHeight)
237-
.onAppear {
238-
headerOffset = 0
239-
isScrollTrackingEnabled = false
240-
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
241-
isScrollTrackingEnabled = true
242-
}
243-
}
244258
}
245259

246260
private var filterBadge: some View {

0 commit comments

Comments
 (0)