easeIn
An animation that starts slowly and then increases speed towards the end of the movement.
Declaration
static var easeIn: Animation { get }Return Value
An ease-in animation with the default duration.
Discussion
An easing animation provides motion with a natural feel by varying the acceleration and deceleration of the animation, which matches how things tend to move in reality. With an ease in animation, the motion starts slowly and increases its speed towards the end.
The easeIn animation has a default duration of 0.35 seconds. To specify a different duration, use easeIn(duration:).
The following code shows an example of animating the size changes of a Circle using the ease in animation.
struct ContentView: View {
@State private var scale = 0.5
var body: some View {
VStack {
Circle()
.scale(scale)
.animation(.easeIn, value: scale)
HStack {
Button("+") { scale += 0.1 }
Button("-") { scale -= 0.1 }
}
}
}
}