shu223 / PulsingHalo

iOS Component for creating a pulsing animation.
MIT License
1.77k stars 240 forks source link

once added as sublayer how to remove it from layer #19

Open vishw3 opened 9 years ago

JustinDMoore commented 9 years ago
        for (CALayer *layer in self.view.layer.sublayers) {
            if ([layer isKindOfClass:[PulsingHaloLayer class]]) {
                [layer removeFromSuperlayer];
            }
        }

This removes all layers that are of type PulsingHaloLayer.

vishw3 commented 9 years ago

thanks will try this ......

elgawady14 commented 5 years ago
    self.view.layer.sublayers = self.view.layer.sublayers?.filter { theLayer in
        !theLayer.isKind(of: PulsingHaloLayer.classForCoder())
    }