blendDuration maybe work in this case

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
swift
Domain
mobile-dev

Research direction

Start by locating the SwiftUI DragGesture example containing the onChanged and onEnded spring animations shown in the issue. Read how blendDuration is currently used there and clarify the intended behavior before deciding what a completed change should demonstrate; the issue does not name a file or test.

Written by the indexing model from the issue text.

Description

                    .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
                                        )
                                }
                            }
                    )
Dominant language
Swift
Stars
811
Forks
45
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.