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 {
1919 . font ( . largeTitle)
2020 . padding ( 16 )
2121 . overlay ( GeometryReaderOverlay ( id: item. 1 ) )
22+ . onTapGesture {
23+
24+ print ( item. 0 )
25+ }
2226 }
2327 }
2428// HStackSnap(snapLocation: .center) {
Original file line number Diff line number Diff line change @@ -22,13 +22,16 @@ public struct HStackSnap<Content: View>: View {
2222
2323 GeometryReader { geometry in
2424
25- ScrollView ( . horizontal ) {
26-
25+ HStack {
26+
2727 HStack ( content: content)
28- . frame ( maxWidth: . infinity)
2928 . offset ( x: scrollOffset, y: . zero)
3029 . animation ( . easeOut( duration: 0.2 ) )
30+
31+ Spacer ( )
3132 }
33+ // TODO: Make this less... janky.
34+ . frame ( width: 10000 )
3235 . onPreferenceChange ( ContentPreferenceKey . self, perform: { preferences in
3336
3437 // Calculate all values once, on render. On-the-fly calculations with GeometryReader
@@ -85,7 +88,6 @@ public struct HStackSnap<Content: View>: View {
8588 }
8689
8790 } )
88- . disabled ( true )
8991 . gesture ( snapDrag)
9092 }
9193 . coordinateSpace ( name: coordinateSpace)
You can’t perform that action at this time.
0 commit comments