2008 04 03Threaded Core Animation
Check out JSCocoa running on the iPhone simulator
If you're animating your
While looping over a collection and adding a CALayer
for each object, you won't see any refresh during the loop : you'll beachball until you've run through your collection, and then your view will update. But as Core Animation is threaded, it's only a matter of saying "I want an update just now".
Use [CATransaction commit]
to have your NSView
update instantly.
If you're animating your CALayer
- create your
CALayer
- flush it to the screen with
[CATransaction commit]
- setup an animation like
layer.transform = CATransform3DMakeRotation(1.57, 0, 0, 1)
- flush it again, still with
[CATransaction commit]
There you go ! That's an easy way to do some work over lots of objects while updating your NSView
easily, without having to worry about threads.
Core Animation
- CocoaNav a Cocoa Class Browser using Core Animation
- Core Animation Starfield Core Animation sample using 3D layers
CoreAnimationStarfield.zip - Core Animation culling problems Don't setup a projection transform on the root layer !
- Threaded Core Animation while on the main thread, update your display with
[CATransaction commit]
CoreAnimationUpdateOnMainThread.zip - Core Animation Bindings binding Cocoa objects to
CALayer
s
Core Animation Bindings.zip - Core Animation Phantom Fade seeing ghosting ? Use two transaction to create and animate your objects
CoreAnimationPhantomFade.zip - Photoshop-like compositing with Core Animation
Blending Modes.zip