1
    Button("forward") {
        withAnimation(.easeInOut.delay(1)) {
            isForward.toggle()
        }
    }

I tried to make my animation slower and smoother however the result i got is freezed animation.

My second try was lowering down the delay value to 0.7 but it did not work too.

2 Answers 2

3

Change from .delay to .speed instead. Lower value = slower speed.

withAnimation(.easeInOut.speed(0.5)) {
        isForward.toggle()
}
Sign up to request clarification or add additional context in comments.

1 Comment

Oh I get it now. Thanks.
1

I think you just wanted to change duration

Button("forward") {
    withAnimation(.easeInOut(duration: 1)) {   // << here !!
        isForward.toggle()
    }
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.