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 UIView.AnimationOptions variable to KeyboardOptions struct #25

Merged
merged 1 commit into from Oct 5, 2018

Conversation

Tylerian
Copy link
Contributor

@Tylerian Tylerian commented Sep 21, 2018

In order to smoothly animate our views at par with iOS keyboard, we must useUIView.animate(withDuration:delay:options:animations:completion:) method which takes UIViewAnimationOptions as it's options argument value.

Right now we must convert KeyboardOptions.animationCurve from UIView.AnimationCurve to UIView.AnimationOptions in order to call our animate function.

To make our lives easier and our code cleaner, I've implemented a helper variable called animationOptions in Typist.KeyboardOptions struct, which transforms a given UIView.AnimationCurve to its respective UIView.AnimationOptions value.

In order to smoothly animate our views at par with iOS keyboard, UIView.animate method takes an UViewAnimationOptions value.
Right now we must convert KeyboardOptions.animationCurve from UIView.AnimationCurve to UIView.AnimationOptions.
To make our code cleaner I've implemented a helper variable animationOptions which transforms a given UIView.AnimationCurve to its respective UIView.AnimationOptions value.
@totocaster
Copy link
Owner

Awesome! Can you update docs in README to reflect this change? Thank you!

@totocaster totocaster merged commit 39996e1 into totocaster:master Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants