Use safe area bar for pinned footers on iOS 26

This commit is contained in:
Elaine
2025-11-04 22:24:26 -05:00
committed by GitHub
parent 4e5cd534d0
commit 6c4db79d04

View File

@@ -21,10 +21,40 @@ public struct ScrollableContentPinnedFooterView<
}
public var body: some View {
#if compiler(>=6.2)
if #available(iOS 26, *) {
iOS26Body
} else {
iOS18Body
}
#else
iOS18Body
#endif
}
#if compiler(>=6.2)
@available(iOS 26, *)
private var iOS26Body: some View {
ScrollView {
scrollableContent
}
.safeAreaBar(edge: .bottom) {
VStack(spacing: 0) {
pinnedFooter
}
.padding(.top, 24)
.padding(.bottom, 12)
}
.scrollBounceBehavior(.basedOnSize)
}
#endif
private var iOS18Body: some View {
VStack(spacing: 0) {
ScrollView {
scrollableContent
}
.scrollBounceBehaviorIfAvailable(.basedOnSize)
Spacer().frame(height: 24)