0

A straightforward question I hope.. I've been looking everywhere for an answer to this question, but can't seem to find one. Does anyone know? Do the UIKit animation blocks operate using a displaylink?

Geoff H
  • 3,107
  • 1
  • 28
  • 53

1 Answers1

2

No, they don't.

The block-based UIView animation API's provide an CAAnimation to the layer via the actionForLayer:forKey: delegate method (the view is always the layers delegate).


I've previously written a blog post about how UIKit animations work in objc.io #12 (approximately the first 20% of the post talks about this interaction between the view and its layer).

David Rönnqvist
  • 56,267
  • 18
  • 167
  • 205
  • Thanks David. Will check it out. I'm trying to run a SKView at the same time as a UIView with a lot of animation going on which causes the UIView stuff to really grind & stutter. I'm assuming this is a clash between SpriteKit's displaylink based timer & the timer mechanism behind the UIView animations.. Should I try to implement my UIView animation blocks using CADisplayLink to make it all smooth? – Geoff H Aug 25 '14 at 17:07
  • That's hard to say with so little information. Also assumptions about performance are often wrong. Use Instruments to measure and see what the bottleneck is. The Core Animation template is a good start. Look at the Time Profiler to see what your app is doing. Depending on what that tells you, you might also get some useful information from the CPU Monitor about how much Core Animation work is being done outside of your process (this may be relevant if your app is mostly doing UIView animations or using Core Animation directly, but it may also tell you nothing at all (being nothing to tell)) – David Rönnqvist Aug 25 '14 at 17:37