I have a custom view which is a subclass of UIView
. I added some sublayers to the custom view but now I want remove them.
I tried doing this:
self.layer.sublayers = nil;
But this will remove everything including the initial sublayers of the view.
Is there any way to achieve this? Or do I have to reinitialise a new custom view every time?
Note: App runs in iOS 7 and above.
Thanks!