Check if a CALayer is already added as a sublayer

calayer, ios, objective-c

Solution

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

Problem

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.

Original source

Related problems