1

The title has it. CALayer has property mask that is of type CALayer. So I have layer A that I want to mask with layer B. Then I want to mask layer B with layer C. It is surely posible to assign values to properties like that. The question is would the layer C influence how layer A is rendered?

Rasto
  • 17,204
  • 47
  • 154
  • 245
  • What happened when you tried it? – matt Mar 03 '16 at 18:15
  • @matt Tried it some time ago but it did not work. I might have made a mystake or there might be some other way (e.g. some combination with `maskView` property of `UIView`). Looking for advice of somebody more experienced or somebody who already made it work. – Rasto Mar 03 '16 at 18:22
  • No, I think your experiment is correct. You can use a mask or clipping as you _construct_ a layer that will be a mask, but a mask layer cannot actively _have_ a mask layer. – matt Mar 03 '16 at 18:24
  • @matt Perhaps there is another way how to combine 2 masks in logical AND or XOR manner (both AND and XOR would do). Using `CAShapeLayer` with `usesEvenOddFillRule` does not work in this case due to low performance when changing and redrawing mask. More here: http://stackoverflow.com/q/35762289/311865 - motivation for this question. – Rasto Mar 03 '16 at 18:33

0 Answers0