Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Animation struct to support customizing animations #58

Closed
mpospese opened this issue Mar 31, 2023 · 0 comments · Fixed by #59
Closed

Add Animation struct to support customizing animations #58

mpospese opened this issue Mar 31, 2023 · 0 comments · Fixed by #59
Assignees
Labels
enhancement New feature or request

Comments

@mpospese
Copy link
Contributor

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.

@mpospese mpospese added the enhancement New feature or request label Mar 31, 2023
@mpospese mpospese self-assigned this Mar 31, 2023
@mpospese mpospese linked a pull request Mar 31, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

1 participant