-
-
Save muhammadabbas001/d0164f3281b75a0abdb4928ec99e8c08 to your computer and use it in GitHub Desktop.
This file contains 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
ZStack { | |
ForEach(0..<views.count) { i in | |
self.views[i] | |
.frame(width: 300, height: getHeight(i)) | |
.animation(.interpolatingSpring(stiffness: 300, damping: 30, initialVelocity: 10)) | |
.background(.white) | |
.cornerRadius(15) | |
.opacity(getOpacity(i)) | |
.offset(x: getOffset(i)) | |
.animation(.interpolatingSpring(stiffness: 300, damping: 30, initialVelocity: 10)) | |
} | |
} | |
.gesture( | |
DragGesture() | |
.updating($dragState) { drag, state, transaction in | |
state = .dragging(translation: drag.translation) | |
} | |
.onEnded(onDragEnded) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment