0

I want to check if CAShapeLayer is visible on screen or not. Does anybody now how to do?

shraddha11
  • 783
  • 4
  • 17

1 Answers1

0

You can't (easily) tell if any of its content is actually visible, but you can see if it is contained by another layer by checking its superlayer property, and check if it's hidden by checking its isHidden property.

Even if it is not hidden and is a sublayer of a layer that's onscreen, it might be covered by other opaque layers. Figuring out if any of its pixels are visible would be much more complex.

Duncan C
  • 128,072
  • 22
  • 173
  • 272