Skip to content

SwiftUI demo does not animate the object smoothly while dragging making a jarring transition when it is released #40

@CalebKierum

Description

@CalebKierum

In the SwiftUI demo the dragging feels stuttery while dragging and buttery smooth while animating. Possibly this was on purpose because the line responsible is offsetAnimator.mode = .nonAnimated that being said I do not think it creates a good example.

I was originally confused that this was the only demo with this problem and thought it was some limitation of SwiftUI and Promotion. However I looked at the internals and everything you're doing with DisplayLink seems correct.

I just copied your pattern from the PIP demo to use an interactive spring while dragging and an animating spring after release and it works great.

Image

AnimationPatch.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions