Closed
Description
Intro
We allow users to customize the appearance of our various components via an Appearance structure.
We should also allow them to customize the animation parameters (duration, delay, options, type of curve, etc). Would be nice if users could choose either spring damping animation or a regular animation curve and we could execute either one (even though they map to two different UIView
class methods).
Task
- Add an
Animation
struct, which should have the following properties:- duration
- delay
- curve type: which can be regular (with options), or spring (with dampingRatio, initialVelocity, and options). Use an enum with associated values.
- Extend
UIView
with a newanimate
class func that takesAnimation
plus animations block and optional completion block as parameters. This method will call the appropriateanimate
override and pass through the various parameters. - Unit test
Discussion
We can use this in YSnackbar to fully customize the add, rearrange, and remove animations.