title: iOS - How To Remove Previously Added Sublayers Of a UIView
body: <p>I have a custom view which is a subclass of <code>UIView</code>. I added some sublayers to the custom view but now I want remove them. </p>
  
  <p>I tried doing this:</p>
  
  <pre><code>self.layer.sublayers = nil;
  </code></pre>
  
  <p>But this will remove everything including the initial sublayers of the view.</p>
  
  <p>Is there any way to achieve this? Or do I have to reinitialise a new custom view every time?</p>
  
  <p><em>Note: App runs in iOS 7 and above.</em></p>
  
  <p>Thanks!</p>