On 19-Jul-08, at 5:41 PM, Steven W Riggins wrote:


On Jul 8, 2008, at 2:54 AM, Scott Anguish wrote:

I've got a longer answer coming... but

There are two ways to interact with layers.

- making a view layer-backed (that is, the view and its subviews will use CALayers as a caching mechanism) - using a view to host layers (inserting your custom layers into the layer hierarchy with the view's layer as the root layer)

in the first case, you should ignore the layers and not interact with them in the second case you should ignore the view, with the exception of resizing, and do all the layer manipulation yourself.


In the second case, would the view handle all interaction, or do the layers get those events as well?


The view that hosts the layers handles the events. CALayer is lightweight and doesn't take part in the responder chain, or handle events.

Now, the hosting view that receives the events can certainly pass them to a layer for handling, but all that is up to the developer to provide support for.

The Core Animation Programing Guide chapter Example: Core Animation Menu Application shows how to handle up and down responder events.. that's basically how you'd do it.

http://developer.apple.com/documentation/Cocoa/Conceptual/CoreAnimation_guide/Articles/Headstart.html#/ /apple_ref/doc/uid/TP40006131
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to