There’s very useful debugging feature in iOS simulator – Toggle slow animations, but it’s only a simulator functionality and there’s no way to have the same while debugging on device. Or is it?
Well, there’s very hidden and unobvious but still working way to achieve the same.
Hit pause while running app on device. lldb will stop at some point, most probably deep in system code, it doesn’t matter.
Type in console following command:
p [(CALayer *)[[[[UIApplication sharedApplication] windows] objectAtIndex:0] layer] setSpeed:.1f]
XCode4.5 and XCode4.6.1 usually take about couple of seconds to run such command for the first time so no worries, just wait. I’ve heard in the latest XCode update (went out yesterday) this issue was fixed, but haven’t tried it yet.
That’s all. Now all the animations – system, initiated from your code directly using any API, will be adjusted to master speed which you just modified.
To understand how it actually works you should recall that CALayer conforms to CAMediaTiming protocol and using this protocol’s methods we can control animation options of entire layer’s tree.