Skip to content

Commit 8675a50

Browse files
committed
Update for iOS 26
1 parent 5cf918e commit 8675a50

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

Sources/AppUI/Extensions/View/View+Shelf.swift

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,38 @@ struct ViewShelf<ShelfContent: View, S: ShapeStyle>: ViewModifier {
2626
}
2727

2828
func body(content: Content) -> some View {
29-
content
30-
.safeAreaInset(edge: .bottom) {
31-
VStack(spacing: spacing) {
32-
shelfContent
33-
}
34-
.horizontallyCentered()
35-
.if(includePadding) {
36-
$0.padding()
37-
}
38-
.background {
39-
Rectangle()
40-
.fill(backgroundFill)
41-
.edgesIgnoringSafeArea(.bottom)
42-
}
29+
if #available(iOS 26.0, watchOS 26, *) {
30+
GlassEffectContainer {
31+
content
32+
.safeAreaInset(edge: .bottom) {
33+
VStack(spacing: spacing) {
34+
shelfContent
35+
}
36+
.horizontallyCentered()
37+
.if(includePadding) {
38+
$0.padding()
39+
}
40+
.glassEffect(in: RoundedRectangle(cornerRadius: 34))
41+
.padding(.horizontal, 8)
42+
}
4343
}
44+
} else {
45+
content
46+
.safeAreaInset(edge: .bottom) {
47+
VStack(spacing: spacing) {
48+
shelfContent
49+
}
50+
.horizontallyCentered()
51+
.if(includePadding) {
52+
$0.padding()
53+
}
54+
.background {
55+
Rectangle()
56+
.fill(backgroundFill)
57+
.edgesIgnoringSafeArea(.bottom)
58+
}
59+
}
60+
}
4461
}
4562
}
4663

0 commit comments

Comments
 (0)