Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the length of `Animation` cases (SwiftUI)?

I haven't found any documentation that indicates what the TimeInterval length is for Animation cases such as .easeIn (SwiftUI). I am looking to cover all cases that don't accept duration as an argument (aka .default, .linear, .easeIn, .easeOut, and .easeInOut), does anyone have this information?

Relevant documentation: https://developer.apple.com/documentation/swiftui/animation

No luck finding a similar question on StackOverflow.

like image 375
Sam Doggett Avatar asked Nov 01 '25 07:11

Sam Doggett


1 Answers

The default TimeInterval for the animations in SwiftUI is 0.35 seconds.

"A method that produces a basic animation with ease-in timing curve, and the given duration. There are variants for the other preset timing curves: .easeOut, .easeInOut and linear. Omitting the duration gives you a default duration of 0.35 seconds. .default is a basic animation with 0.35 seconds duration and an ease-in-ease-out timing curve."

https://www.kodeco.com/books/ios-animations-by-tutorials/v6.0/chapters/1-introduction-to-animations-with-swiftui

like image 54
Thomas Dini Avatar answered Nov 04 '25 04:11

Thomas Dini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!