Handling multiple layers in a UIView
I have a UIView called ContentPage which contains PDF contents. The PDF's contents are drawn inside the `drawLayer:inContext:` of the ContentPage. Now what I want to do is to add freeform drawing function so that the user can draw shapes or anything while reading the PDF. Now here are my questions:

1. If I add a layer by using this:

   `CALayer *drawLayer = [CALayer layer];`

    `drawLayer.frame = self.frame;`

    `[drawLayer setBackgroundColor:[UIColor clearColor].CGColor]; //not sure if this is correct`
    
    `[self.layer addSublayer:drawLayer];`

   How will I handle the delegate of this layer? I am aware that a UIView can't be a delegate of another layer since it is the delegate of its own (In this case, the view's layer is already being used to draw the PDF contents into it), so if I want to have my custom drawings inside the layer I added, where should I set my delegate?

2. I want the drawings to appear as if they were being drawn *under* the text. What I did is use the `kCGBlendModeMultiply`, but since I'll be drawing in another layer, will this have the same effect?

3. I want the drawings to be saved when the user taps a button. When I used UIImage as the drawing area, I was able to save it by creating a folder and save the image as a PNG Representation. Now if the drawing is created in the layer, will I be able to save it as well? 

I hope someone can answer my questions, or at least give some clarifications. Any help will be very much appreciated.

    

Handling multiple layers in a UIView
===

I have a UIView called ContentPage which contains PDF contents. The PDF's contents are drawn inside the `drawLayer:inContext:` of the ContentPage. Now what I want to do is to add freeform drawing function so that the user can draw shapes or anything while reading the PDF. Now here are my questions:

1. If I add a layer by using this:

   `CALayer *drawLayer = [CALayer layer];`

    `drawLayer.frame = self.frame;`

    `[drawLayer setBackgroundColor:[UIColor clearColor].CGColor]; //not sure if this is correct`
    
    `[self.layer addSublayer:drawLayer];`

   How will I handle the delegate of this layer? I am aware that a UIView can't be a delegate of another layer since it is the delegate of its own (In this case, the view's layer is already being used to draw the PDF contents into it), so if I want to have my custom drawings inside the layer I added, where should I set my delegate?

2. I want the drawings to appear as if they were being drawn *under* the text. What I did is use the `kCGBlendModeMultiply`, but since I'll be drawing in another layer, will this have the same effect?

3. I want the drawings to be saved when the user taps a button. When I used UIImage as the drawing area, I was able to save it by creating a folder and save the image as a PNG Representation. Now if the drawing is created in the layer, will I be able to save it as well? 

I hope someone can answer my questions, or at least give some clarifications. Any help will be very much appreciated.

    
