This project aims to provide easing functions in swift in the simplest way possible.
Easing functions provide us to map an input range to an output range in various ways to create mathematical relations to use in our app. They are commonly used in visual animations and transitions.
Easing functions specify the rate of change of a parameter over time. - easings.net
See easings.net for a more detailed look into specifics each easing function.
- Define an input and an output range.
let inputRange: ClosedRange<Double> = 0.0...1.0
let outputRange: ClosedRange<Double> = 0.0...10.0
- Initialize Swease
let swease = Swease(inputRange: inputRange, outputRange: outputRange)
- Map values
swease.map(value: 0.5, easing: .ease_in) // = 1.25