Created
July 16, 2020 19:19
-
-
Save azamsharp/6d5a1a52444d2092a6d746fd6a33fb8f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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