Image:CocoaNav icon.png

PARMANOIR

Threaded Core Animation : sample code

Another Core Animation sample, serving as sample code for Threaded Core Animation.

Image:CoreAnimationUpdateOnMainThread.jpg

This will be a bit clearer than just text and shows how Core Animation can update itself even when you're busy on the main thread, using [CATransaction commit].

The transitions happen thanks to [CATransaction setValue:[NSNumber numberWithFloat:0.0] forKey:kCATransactionAnimationDuration] which changes the default speed of interpolation to a new value. When you set a new value of a layer attribute, CA will interpolate from its current value to the new one with a set delay. If you want to make a transition, you can't go around setting your start value and then your end value : CA will start interpolating from current to start, but then you'll be setting a new value, the end one, right when CA has just started interpolating !

kCATransactionAnimationDuration lets us get rid of that delay while setting our start value, CA can then interpolate from our transition start value to the end value.

Image:iconZip.png CoreAnimationUpdateOnMainThread.zip

Core Animation

Jonathan Wight
2008 05 24

Hey there, your blog is awesome. I love the CoreAnimation postings especially. However, for some reason NNW keeps thinking your site is constantly updating the old blog posts and they keep appearing in my feed. I'm wondering if the problem is your end and if you'd take to look at fixing it?

Cheers.

Patrick Geiller
2008 05 24

That's because they are updated :) I use a template at the bottom of the Core Animation posts, when I add a new post I'll update the template with it and the old posts will get the new version of the template as well. I didn't realize this would mark the old posts as new. I'll look into it.

2008 07 25Where in build phases is that file ?
2008 07 192Imagine clickable error messages
2008 07 18Succulent Stormhoek
2008 07 173Loving the for
2008 07 12(Parmanoir) Feed now validates
2008 07 108Telling classes from instances
2008 07 08Comma Trick
2008 07 06Using libffi
2008 07 04BridgeSupport's type and type64
2008 07 042Clickable Disabled MenuItems
2008 07 026Less bugs through compiler optimizations
2008 06 251CocoaNav JS, a light CocoaNav for Safari
2008 06 232NSWindow goodies : bottomCornerRounded, usesLightBottomGradient
2008 06 222Inspecting NSUndoManager's undo stack
2008 06 16Cocoa Regular Expressions via JavascriptCore
2008 06 15Crossing the WebKit bridge
2008 06 08Double and Triple Click
2008 06 05Photoshop-like compositing with Core Animation
2008 06 052One way binding to NSSlider
2008 05 30Threaded Core Animation, Part Deux
Image:rss.png
Image:rss.png

Powered by MediaWiki

Hi ! I'm learning Cocoa to (hopefully !) become an indie developer.

I've written software all my professional life, in C++, PHP, Javascript. I've designed websites and web interfaces. My last venture went into flames as clients were happy but didn't like paying very much.

I've had little luck in the B2B world, I'm hoping for a better future writing Mac applications.

Planet Cocoa