Skip to content

Commit 2f39c86

Browse files
committed
Fix compile issues for visionOS
1 parent 2cb493f commit 2f39c86

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

Sources/AppUI/Components/Filters/TabFilter.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ public struct TabFilter<Tab: TabFilterItem>: View where Tab.AllCases: RandomAcce
2727
ForEach(Tab.allCases) { tab in
2828
tabView(for: tab)
2929
.contentShape(Rectangle())
30+
#if !os(visionOS)
3031
.sensoryFeedback(.impact, trigger: selectedTab)
32+
#endif
3133
.onTapGesture {
3234
selectedTab = tab
3335
}

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

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ struct ViewShelf<ShelfContent: View, S: ShapeStyle>: ViewModifier {
2626
}
2727

2828
func body(content: Content) -> some View {
29+
#if os(visionOS)
30+
legacyLayout(for: content)
31+
#else
2932
if #available(iOS 26.0, watchOS 26, macOS 26, *) {
3033
GlassEffectContainer {
3134
content
@@ -42,22 +45,27 @@ struct ViewShelf<ShelfContent: View, S: ShapeStyle>: ViewModifier {
4245
}
4346
}
4447
} 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-
}
48+
legacyLayout(for: content)
6049
}
50+
#endif
51+
}
52+
53+
func legacyLayout(for content: Content) -> some View {
54+
content
55+
.safeAreaInset(edge: .bottom) {
56+
VStack(spacing: spacing) {
57+
shelfContent
58+
}
59+
.horizontallyCentered()
60+
.if(includePadding) {
61+
$0.padding()
62+
}
63+
.background {
64+
Rectangle()
65+
.fill(backgroundFill)
66+
.edgesIgnoringSafeArea(.bottom)
67+
}
68+
}
6169
}
6270
}
6371

0 commit comments

Comments
 (0)