I'am just playing around with CA lately. Now I am kind of stuck. This is the thing I want to animate:
As for now I already got the circle animation working. I subclassed CALayer to make the animation. I really don't know where to go from here. Where do I have to add the sublayer of CATextLayer? How do I animate both at the same time so it looks like the text with its line is sticking at the circle end?
If you need some code or anything else let me know.
I would be really happy to get some help here :-)
Thanks a lot!
I was able to do what you are asking for below. Code is very rough, just spent a couple minutes on it, may have missed releases and what have you. You can simply swap the UILabel for a CATextLayer (used UILabel for brevity).
I would suggest creating a new UIView class, and then use the method layoutSubviews.
For more on the UIView class, just have a look at the class reference. Just use something lie this in your main view:
And something like this for layoutSubviews:
Of course, your will have to add the implementation for myView over in your .h, but otherwise everything else should work.
EDIT: Sorry, I forgot to add the text layer code into layoutSubview, but all you to do is create the layer and set its position to mainLayer.position;