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
[QUESTION] Custom logic during animation #501
Comments
@dzamani I can't figure out a way how can we change the text during the animation using IBAnimatable. If you would like to have this feature. What kind of API would you like to see? another closure in the chainable API? Thanks. |
Yes a closure would be perfect as it would allow nearly anything. |
@dzamani thanks, let's how can we improve it. We have some Core Animation as well. Since we already use |
@JakeLin Adding 2 closures would be the perfect solution, one inside UIView.animate animations and one inside UIView.animate completion handler. |
@dzamani we are using chainable API, it will be a promise-like method. And we already have completion method for completion handler
how can we name the method to run one inside UIView.animate? |
Well it's not the same behaviour, if the custom logic (switching text for example) was working with your completion handler I wouldn't need to user UIView.animate (like you can see in my example, the logic is inside the completion handler). If I use your completion handler, it switch way after the animation which is not what I want. For the name we could call it animationHandler or animationCallback something like that. |
If I did understand well, you want another closure which will be called while the animation is running? Then, what about a |
may call it like |
Hi,
I may have overlooked solutions and questions already in the issues but I think there isn't something like that. I was wondering if there was a way to add custom logic during an animation, for example take a UIView with some labels inside, I want a flip animation and when I flip I will switch the text inside the labels.
My current code (which is working) looks like this :
Of course I tried the completion block but it's not what I want since it will do the switch after the animation.
Also, while I could do my own custom transition or whatever but that wouldn't be very flexible like I want it.
Maybe there is another way I didn't get while reading the examples and docs or maybe there is no developed way to do that and in that case is there a good practice to follow ?
Thanks !
The text was updated successfully, but these errors were encountered: