Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created July 16, 2020 19:19
Show Gist options
  • Save azamsharp/6d5a1a52444d2092a6d746fd6a33fb8f to your computer and use it in GitHub Desktop.
Save azamsharp/6d5a1a52444d2092a6d746fd6a33fb8f to your computer and use it in GitHub Desktop.
@State private var couponId: Int = 0
var body: some View {
ScrollView {
VStack(spacing: -50) {
ForEach(1...20, id: \.self) { index in
CouponCell()
.zIndex(couponId == index ? 2 : 0)
.animation(.spring())
.onTapGesture {
withAnimation {
couponId = index
}
}
}
}
.padding().frame(maxWidth: .infinity, maxHeight: .infinity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment