Scrolling stops iOS animation

My problem is pretty simple, on my UIVIewController I have a custom UIView that animates with CAAnimation and UIViewAnimation, I also have UIScrollView when scrollView scrolls through an animated UIView, stops all of its animations!

timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateClock:) userInfo:nil repeats:YES]; hourHand.transform = CATransform3DMakeRotation (hourAngle+M_PI, 0, 0, 1); ... 

In animated form, I use: NSTimer, QuartzCore, and UIViewAnimation.

How can this be avoided? Is it because I'm using a custom UIView? (I'm still a beginner)

Thanks everyone!

+4
source share
1 answer

You may be interested in this question. UIScrollView scroll lock blocks UIView animation

The proposed solution is to add a timer to the current loop.

 [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; 
+7
source

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


All Articles