Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is the presentation layer of a CALayer generated?

I'm having difficulties animating my custom layer property using Core Anmiation.
My question is how the presentation of a CALayer is generated. Here is what I have now:

    @interface MyLayer : CALayer {
      NSMutableDictionary* customProperties;
    }

    @property (nonatomic, copy) NSMutableDictionary* customProperties;

    @end

And when I try to animate the key path "customProperties.roll" using CABasicAnimation and addAnimation:forKey:, it seems that the customProperties variable doesn't get copied from the model layer to the presentation layer, and the customProperties of the presentation layer appears to be nil, failing to update the value for the key "roll".
Is there a way to animate values in a dictionary correctly? What is the exact relationship between a model layer and a presentation layer while being animated?
Thanks!

like image 954
Kay Avatar asked May 09 '10 08:05

Kay


People also ask

What is presentation layer protocol?

The presentation layer is responsible for presenting the data to the application layer. This may include some form of format or character translation. This guarantees a common representation of the data while in transit.

What is a CALayer?

A CALayer is a layer in the composition stack which goes on top of some layers, and potentially underneath other layers.

Are often used to provide the backing store for views but can also be used without a view to display content?

Layers are often used to provide the backing store for views but can also be used without a view to display content. A layer's main job is to manage the visual content that you provide but the layer itself has visual attributes that can be set, such as a background color, border, and shadow.


1 Answers

Override the initWithLayer: method.

like image 150
Peter Hosey Avatar answered Sep 23 '22 21:09

Peter Hosey