UIView-EasingFunctions icon indicating copy to clipboard operation
UIView-EasingFunctions copied to clipboard

iOS8: Setting an EasingFunction in a View Segue changes the frame

Open glenstorey opened this issue 11 years ago • 4 comments

If you set an easing function for an animation which runs in a segue, the coordinates of the start and end frames for the view change (or perhaps it just ignores the ones you set). Commenting out the easing function returns to the expected beginning and end points.

Here's an example animation block (inside a segue between two view controllers): [UIView animateWithDuration:2.0 delay:delay options:UIViewAnimationOptionCurveEaseOut animations:^{ [view setEasingFunction:QuinticEaseInOut forKeyPath:@"frame"]; view.frame = CGRectMake(view.frame.origin.x, view.frame.origin.y-1024, view.frame.size.width, view.frame.size.height); //start view.frame=CGRectMake(view.frame.origin.x, view.frame.origin.y....)

Commenting out the [view setEasingFunction... line has an expected start and end point, uncommenting it sets it to a negative value, and ignores my start and end points.

Not sure if this is my problem or something in AHEasing - keen to help solve it but not sure where to begin!

UPDATE: It seems that any animation I set up in iOS 8 ignores the start and end points of the animation, not just those in segues. Surely I'm not the only one experiencing this?

glenstorey avatar Aug 26 '14 19:08 glenstorey

I noticed similar issues with custom easing functions not working in my app on iOS8. The animation occurred way off of the frame of where it should be. I was able to fix my issue in easing_addAnimation(), by setting override.additive = basicAnimation.isAdditive.

almiki avatar Sep 15 '14 22:09 almiki

Oh good. In my easing_addAnimation method override doesn't have a property called additive. Are you able to give me a bit more information about how I should change the method to fix this problem? Do I need to change override to a CABasicAnimation? Where should I set the values?

glenstorey avatar Sep 17 '14 18:09 glenstorey

@almiki thanks a lot for the fix. @glenstorey in order to access the additive property you have to change the type of the variable "override" from CAAnimation* to CAKeyframeAnimation*.

demerzel3 avatar Sep 21 '14 16:09 demerzel3

Thanks so much. I'd buy you a beer if we weren't all on different sides of the planet. Not sure if I should close the issue since there's a fix - will leave that to you.

glenstorey avatar Sep 21 '14 17:09 glenstorey