Closed kennyDang closed 5 years ago
Well, it's been a long time but better late than never. @kennyDang why is the expected behavior to return to its original position? The reversed
property determines if an animation should run in the opposite direction so its end position won't be the original one. I guess this might be slightly confusing since using reversed: false
returns the animated view to its original position correctly. But you can work around it using a negative offset for the AnimationType
and using reversed: false
.
Expected Behavior
I have a button that uses an
AnimationType(.bottom, offset: 10)
animation whenever it is tapped. The button should perform the animation and return to its original position.Actual Behavior
The button performs the animation but changes it's y position with every tap. For example, here is the CGRect of the button for each button animation:
Steps to Reproduce the Problem
Press button and animate it:
UIView.animate(views: [button], animations: [buttonAnimation], reversed: true, initialAlpha: 1.0, finalAlpha: 0.0, completion: {print(self.button.frame)})
Specifications