Monday, November 18, 2013

iOS: Selectively Exclude Animations

The animation framework in Apple iOS allows you to create amazing effects insanely easily. However, sometimes getting animations to work the way you want can be a tricky business.

I sometimes find things are animating when I don't want them to. Here's a quick bit of code to exclude certain actions from animating:
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithBool:YES] forKey:kCATransactionDisableActions];
// Add your action here
[CATransaction commit];

No comments:

Post a Comment