Help with stock ticker style scrolling using Core Animation

Posted by Glen Harding on Stack Overflow See other posts from Stack Overflow or by Glen Harding
Published on 2010-03-09T14:10:14Z Indexed on 2010/03/13 15:45 UTC
Read the original article Hit count: 697

Filed under:
|
|

Hi, I'm looking for some guidance on the best way to implement stock ticker style right-to-left scrolling of CALayers in Core Animation on OSX. I'm pretty new to Cocoa and don't know the best way to implement this.

I have a continuous stream of news items and stock details that I turn into CALayers (made up of 1 image and a CATextLayer) and I want to animate the CALayers from right to left of my custom view.

The news and stock information is constantly updating so I would like to add 1 item at a time to the view, scroll it right to left until the right-most point of the CALayer is showing, then add another CALayer to the view and start scrolling that as well. I would like to do this dynamic updating instead of taking a big snapshot of all my data, turning it into a big horizontal CALayer and scrolling that.

I'm looking for guidance on how to achieve this sort of effect -

do I manually animate each new CALayer along a path in the view? Or should I be using CAScrollLayer to achieve this effect?

Many thanks Glen.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about core-animation