How to perform a selection
Insfgg99x opened this issue · comments
CGPointZero commented
Is there any interface like this:
didSelectItemAtIndexPath
Thanks!
Paolo Leonardi commented
Hi @Insfgg99x
you could just attach a tap action to your grid views.
i.e.
WaterfallGrid(rectangles) { rectangle in
RectangleView(rectangle: rectangle)
.onTapGesture {
print("Tap action")
}
}
or
WaterfallGrid((0..<cards.count), id: \.self) { index in
CardView(card: self.cards[index])
.onTapGesture {
print("Did select item at index \(index)")
}
}
Hope this helps
Thanks!