Using CALayer Delegate

前端 未结 8 1100
滥情空心
滥情空心 2020-12-02 08:44

I have a UIView whose layers will have sublayers. I\'d like to assign delegates for each of those sublayers, so the delegate method can tell the layer what to draw. My que

8条回答
  •  爱一瞬间的悲伤
    2020-12-02 09:12

    Can you use the passed in layer parameter to construct a switch statement so you can put everything in this method(against the advice of the documents):

    -(void) drawLayer: (CALayer*) layer inContext: (CGContextRef) context {
       if layer = xLayer {...}
     }
    

    Just my 2 cents.

提交回复
热议问题