swiftui-spring-animations icon indicating copy to clipboard operation
swiftui-spring-animations copied to clipboard

blendDuration maybe work in this case

Open nangonghan opened this issue 4 months ago • 0 comments

                    .gesture(
                        DragGesture()
                            .onChanged { value in
                                guard !isAnimating else { return }
                                // Update the position while dragging with 弹性跟手
                                withAnimation(.spring(duration: onChangedDuration, bounce: onChangedBounce)) {
                                    self.position = value.location
                                }
                            }
                            .onEnded { _ in
                                guard !isAnimating else { return }
                                // Animate back to center when released with 速度继承
                                withAnimation(.spring(duration: onEndedDuration, bounce: onEndedBounce,blendDuration: 0.25)) {
self.position = CGPoint(
                                            x: geometry.size.width / 2,
                                            y: geometry.size.height / 2
                                        )
                                }
                            }
                    )

nangonghan avatar Aug 13 '25 09:08 nangonghan