EaseFunction
public enum EaseFunction
An easing function that determines the path used to get from point A to point B by calculating the position given a specific point in time.
These easing functions are based upon Robert Penner’s Easing Functions. A visualized cheat-sheet of these functions can be found at easings.net.
The aspect of time is crucial to motion — things change over time. Nothing can move in “zero time”, or be in two places at once. In other words, a position needs time to change, and it can have only one value at a specific point in time.
Because position and time have this one-to-one relationship, we can say that position is a function of time. This means that, given a specific point in time, we can find one, and only one, corresponding position.
-
Calculates the
yvalue for coordinatexusing linear easing.Declaration
Swift
public static func linear(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing sinusoidal-in easing.Declaration
Swift
public static func sineIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing sinusoidal-out easing.Declaration
Swift
public static func sineOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing sinusoidal-in-out easing.Declaration
Swift
public static func sineInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing cubic-in easing.Declaration
Swift
public static func cubicIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing cubic-out easing.Declaration
Swift
public static func cubicOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing cubic-in-out easing.Declaration
Swift
public static func cubicInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing quadratic-in easing.Declaration
Swift
public static func quadIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing quadratic-out easing.Declaration
Swift
public static func quadOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing quadratic-in-out easing.Declaration
Swift
public static func quadInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing quartic-in easing.Declaration
Swift
public static func quartIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing quartic-out easing.Declaration
Swift
public static func quartOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing quartic-in-out easing.Declaration
Swift
public static func quartInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing quintic-in easing.Declaration
Swift
public static func quintIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing quintic-out easing.Declaration
Swift
public static func quintOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing quintic-in-out easing.Declaration
Swift
public static func quintInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing exponential-in easing.Declaration
Swift
public static func expoIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing exponential-out easing.Declaration
Swift
public static func expoOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing exponential-in-out easing.Declaration
Swift
public static func expoInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing circular-in easing.Declaration
Swift
public static func circIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing circular-out easing.Declaration
Swift
public static func circOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing circular-in-out easing.Declaration
Swift
public static func circInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing back-in easing.Declaration
Swift
public static func backIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing back-out easing.Declaration
Swift
public static func backOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing back-in-out easing.Declaration
Swift
public static func backInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing elastic-in easing.Declaration
Swift
public static func elasticIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing elastic-out easing.Declaration
Swift
public static func elasticOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing elastic-in-out easing.Declaration
Swift
public static func elasticInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
-
Calculates the
yvalue for coordinatexusing bounce-in easing.Declaration
Swift
public static func bounceIn(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing bounce-out easing.Declaration
Swift
public static func bounceOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1]. -
Calculates the
yvalue for coordinatexusing bounce-in-out easing.Declaration
Swift
public static func bounceInOut(_ x: Double) -> DoubleParameters
xThe
xcoordinate to which theyvalue is returned, between [0, 1].Return Value
The
yvalue for coordinatex, between [0, 1].
View on GitHub
EaseFunction Enumeration Reference