Easing
public class Easing
extension Easing: NativeBase
extension Easing: Hashable
Animation easing representing an easing function to be used during animations.
-
Thrown when a problem occurs while trying to create an
Easing.Declaration
Swift
public typealias InstantiationError = InstantiationErrorCode -
Creates an instance of
Easingusing a predefined easing function.Declaration
Swift
public init(_ easingFunction: EasingFunction)Parameters
easingFunctionEasing function.
-
Creates an instance of customized
Easingusing a specified number of points describing an easing function.Throws
Easing.InstantiationErrorInstantiation error in case of invalid input parameters.Declaration
Swift
public init(_ points: [Point2D]) throwsParameters
pointsList of sampled data points that define an easing function. X describes normalized time values in the range [0, 1]. Y describes normalized animated value changes. Values can fall outside of the range [0, 1]. During an animation run animated target value is multiplied with Y value. In case resulting animated target value falls outside of its own supported range it will be clamped to its range (e.g. when negative values used for color animation). X values must increase monotonically. There must be at least 2 data points specified. The first point’s X value must be 0, the last point’s X value must be 1. During an animation run for any given time value X’ from the animation engine that satisfies the relation X(i) < X’ < X(i+1) for the given X data points the corresponding Y’ value will be calculated by linearly interpolating between Y(i) and Y(i+1) data points. The higher the sampling rate of the easing curve used for the data points the more precise the results. In order to achieve the same animation precision for animations with different durations (shorter vs longer) it is recommended to use a higher sampling rate for longer animation duration.