Skip to content

Add Animation struct to support customizing animations #58

Closed
@mpospese

Description

@mpospese

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:
    1. duration
    2. delay
    3. 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 new animate class func that takes Animation plus animations block and optional completion block as parameters. This method will call the appropriate animate 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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions