File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ struct ContentView: View {
19
19
. font ( . largeTitle)
20
20
. padding ( 16 )
21
21
. overlay ( GeometryReaderOverlay ( id: item. 1 ) )
22
+ . onTapGesture {
23
+
24
+ print ( item. 0 )
25
+ }
22
26
}
23
27
}
24
28
// HStackSnap(snapLocation: .center) {
Original file line number Diff line number Diff line change @@ -22,13 +22,16 @@ public struct HStackSnap<Content: View>: View {
22
22
23
23
GeometryReader { geometry in
24
24
25
- ScrollView ( . horizontal ) {
26
-
25
+ HStack {
26
+
27
27
HStack ( content: content)
28
- . frame ( maxWidth: . infinity)
29
28
. offset ( x: scrollOffset, y: . zero)
30
29
. animation ( . easeOut( duration: 0.2 ) )
30
+
31
+ Spacer ( )
31
32
}
33
+ // TODO: Make this less... janky.
34
+ . frame ( width: 10000 )
32
35
. onPreferenceChange ( ContentPreferenceKey . self, perform: { preferences in
33
36
34
37
// Calculate all values once, on render. On-the-fly calculations with GeometryReader
@@ -85,7 +88,6 @@ public struct HStackSnap<Content: View>: View {
85
88
}
86
89
87
90
} )
88
- . disabled ( true )
89
91
. gesture ( snapDrag)
90
92
}
91
93
. coordinateSpace ( name: coordinateSpace)
You can’t perform that action at this time.
0 commit comments