Animation UIView VS core animation

I am trying to animate a view that slides in the view and bounces when it hits the screen.

The main example of the slide that I am doing is as follows:

// The view is added with a rect making it off screen.
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:0.07];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[theView setFrame:CGRectMake(-5, 0, theView.frame.size.width, theView.frame.size.height)];
[UIView commitAnimations];

Then, more animations are called in didStopSelector to make a bounce effect. The problem is that when animating more than one view, the rebound becomes a jerk and, well, it no longer bounces.

Before starting to read about how to do this in Core Animation (I understand this is a bit more complicated), I would like to know if there is an advantage to using Core Animation rather than UIView animation. If not, is there something I can do to improve performance?

+3
1

Core Animation (Layer based) , 3D- ( 3D-).

UiView , . , . , (70 - 14 ). UIView , - 0,2 . .

+6

Source: https://habr.com/ru/post/1748194/


All Articles