/* An object providing thecontentsofthe layer, typically a CGImageRef, * but may be something else. (For example, NSImage objects are * supported on Mac OS X 10.6and later.) Default value is nil. * Animatable. */
If you are using the layer to display a static image, you can set this property to the CGImageRef containing the image you want to display. Assigning a value to this property causes the layer to use your image rather than create a separate backing store.
/* Reload the content of this layer. Calls the -drawInContext: method * then updates the `contents' property of the layer. Typically this is * not called directly. */
/* Called via the -display method when the `contents' property is being * updated. Default implementation does nothing. The context may be * clipped to protect valid layer content. Subclasses that wish to find * the actual region to draw can call CGContextGetClipBoundingBox(). */
- (void)drawInContext:(CGContextRef)ctx;
/* If defined, called by the default implementation of -drawInContext: */
Draws the layer’s content using the specified graphics context.The defaultimplementationof this methoddoesnotdoanydrawingitself. Ifthelayer’sdelegateimplementsthedrawLayer:inContext: method, thatmethodiscalledtodotheactualdrawing. Subclassescanoverridethismethodanduseittodrawthelayer’scontent. Whendrawing, allcoordinatesshouldbespecifiedinpointsinthelogicalcoordinatespace.
/* An "action" is an object that responds to an "event" via the * CAAction protocol (see below). Events are named using standard * dot-separated key paths. Each layer defines a mapping from event key * paths to action objects. Events are posted by looking up the action * object associated with the key path and sending it the method * defined by the CAAction protocol. * * When an action object is invoked it receives three parameters: the * key path naming the event, the object on which the event happened * (i.e. the layer), and optionally a dictionary of named arguments * specific to each event. * * To provide implicit animations for layer properties, an event with * the same name as each property is posted whenever the value of the * property is modified. A suitable CAAnimation object is associated by * default with each implicit event (CAAnimation implements the action * protocol). * * The layer class also defines the following events that are not * linked directly to properties: * * onOrderIn * Invoked when the layer is made visible, i.e. either its * superlayer becomes visible, or it's added as a sublayer of a * visible layer * * onOrderOut * Invoked when the layer becomes non-visible. */
/* Returns the default action object associated with the event named by * the string 'event'. The default implementation returns a suitable * animation object for events posted by animatable properties, nil * otherwise. */
/* Returns the action object associated with the event named by the * string 'event'. The default implementation searches for an action * object in the following places: * * 1. if defined, call the delegate method -actionForLayer:forKey: * 2. look in the layer's `actions' dictionary * 3. look in any `actions' dictionaries in the `style' hierarchy * 4. call +defaultActionForKey: on the layer's class * * If any of these steps results in a non-nil action object, the * following steps are ignored. If the final result is an instance of * NSNull, it is converted to `nil'. */
/* If defined, called by the default implementation of the * -actionForKey: method. Should return an object implementing the * CAAction protocol. May return 'nil' if the delegate doesn't specify * a behavior for the current event. Returning the null object (i.e. * '[NSNull null]') explicitly forces no further search. (I.e. the * +defaultActionForKey: method will not be called.) */
Returns a copy of the presentation layer object that represents the state of the layer as it currently appears onscreen.
Discussion The layer object returned by this method provides a close approximation of the layer that is currently being displayed onscreen. While an animation is in progress, you can retrieve this object and use it to get the current values for those animations. The sublayers, mask, and superlayer properties of the returned layer return the corresponding objects from the presentation tree (not the model tree). This pattern also applies to any read-only layer methods. For example, the hitTest: method of the returned object queries the layer objects in the presentation tree.
Returns the model layer object associated with the receiver, if any.
Discussion Calling this method on a layer in the presentation tree returns the corresponding layer object in the model tree. This method returns a value only when a transaction involving changes to the presentation layer is in progress. If no transaction is in progress, the results of calling this method are undefined.
/* Defines the anchor point of the layer's bounds rect, as a point in * normalized layer coordinates - '(0, 0)' is the bottom left corner of * the bounds rect, '(1, 1)' is the top right corner. Defaults to * '(0.5, 0.5)', i.e. the center of the bounds rect. Animatable. */