0

How can I run implicit of explicit animations (e.g. CAKeyframeAnimation) on a high priority thread / queue. I made a custom UI with CoreAnimation and I want it to be the most repsonsive part of the whole app. Basically exactly like Apple did with UITableViews.

Once you scroll them, other parts of your application might simply stop.

Max
  • 2,699
  • 2
  • 27
  • 50
  • 1
    Explicit animations already run at a higher priority than the rest of your app. What parts are you trying to "stop"? Have you looked at the different run loop modes? `NSDefaultRunLoopMode` [should not fire while scrolling](http://stackoverflow.com/questions/7222449/nsdefaultrunloopmode-vs-nsrunloopcommonmodes). – David Rönnqvist May 22 '14 at 10:28
  • Ah okay, I wasn't aware of that. After I'm triggering some part of standard UI (e.g. opening a UIPopover), the first explicit animation I use does lagg (a bit), after that, everything is smooth. This happens even if I open popover --> wait 5 seconds --> use animation. But it's not only with a popover, also with a full screen transition etc. – Max May 22 '14 at 10:50
  • It took a couple of minutes to find [this reference](https://twitter.com/andy_matuschak/status/464790108072206337): "render server runs at higher priority than your app can." – David Rönnqvist May 22 '14 at 10:53
  • If your app is lagging: use instruments and measure, measure, measure. Determine what the bottleneck is and measure again to verify that any change you make actually improves the performance – David Rönnqvist May 22 '14 at 10:55
  • Ah okay, I didn't find that, thank you! I'll do that yes, but I was just wondering if this is something special. Since the lag happens after a very specific scheme, every time I use a part of Apple standard UI, even a UISlider or a UIButton causes the next run of my animation to lag. Triggering it again afterwards makes it run perfectly smooth. – Max May 22 '14 at 11:00

0 Answers0