Drawing with Core Graphics in a CALayer?

To do custom drawing you have two options: Subclass CALayer and implement drawInContext: Make your own class that serves as your layer's delegate to perform the Quartz routines. It should implement drawLayer:inContext: You should add your custom layer as a sublayer to your UIView's layer. You should take a spin through CALayer's doc pages for some rules about how to interact with the view's layer.

To do custom drawing you have two options: Subclass CALayer and implement -drawInContext:. Make your own class that serves as your layer's delegate to perform the Quartz routines. It should implement -drawLayer:inContext:.

You should add your custom layer as a sublayer to your UIView's layer. You should take a spin through CALayer's doc pages for some rules about how to interact with the view's layer.

Thank you! I will give this a try and follow up. – shawnzizzo Jun 13 at 13:43 I just read you can make your custom layer the UIView's layer by subclassing UIView and implementing +layerClass to return your custom layer class.

You would do this instead of adding your custom layer as a sublayer of the view's layer (whew). – pe8ter Jun 24 at 23:52.

I'm trying to get my head around Core Graphics and Core Animation. Using UIView, I can draw with Core Graphics by overriding drawRect. - If I create a CALayer from scratch (not using something like CALayer *myLayer = myUIView.

Layer), what is the approach to draw in that CALayer? - What's the CALayer's equivalent of drawRect for UIView? I hope that makes sense.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions