Search code examples
objective-cioscalayer

Check if a CALayer is already added as a sublayer


I have 5 CALayers each one is a property. Say I added 3 of them as subviews. I need to ba able to chk if one of the layers is already added to the layer.


Solution

  • Have you tried the superlayer property ? It should be nil if your layer isn't added anywhere.