Interpolatable
public protocol Interpolatable
A type that can be interpolated from a start and end value.
-
Calculates the value between a start and end position at a specific point in time.
Declaration
Swift
static func interpolate(from start: Self, to end: Self, time: TimeInterval) -> Self
Parameters
start
The start value to interpolate from, the minimum value.
end
The end value to interpolate to, the maximum value.
time
A percentage between 0 and 1 that represents time. The interpolated value is calculated by multiplying the change in value by the percentage of time.
Return Value
The value interpolated between the start and end.