I have trouble with deleting all of layer's sublayers. I currently do this manually, but that brings unnecessary clutter. I found many topics about this in google, but no answer.
I tried to do something like this:
for(CALayer *layer in rootLayer.sublayers)
The simplest way to remove all sublayers from a layer is to set the sublayer property to nil:
rootLayer.sublayers = nil;