title: When is the right time to animate and add sublayers in an UIView subclass
body: <p>If I create a subclassed <code>UIView</code> and want to use a bunch of custom made content (animations via <code>CABasicAnimation</code> using <code>CAShapeLayer</code>s, custom made drawings using <code>CGContextRef</code> in <code>drawRect</code>) when is the right time to create, add and animate sublayers?</p>
  
  <p>I know that I should perform custom drawings in the <code>drawRect</code> method (and since there is the only place when I can actually get <code>UIGraphicsGetCurrentContext()</code> that kinda narrows my choice down). Now I have been creating sublayers, animations and all that other non-drawing related stuff in the <code>drawRect</code> as well. But I'm not sure that <code>drawRect</code> is the best place to do those kind of activities.</p>
  
  <p>I am familiar with <code>layoutSubviews</code> method and some other <code>UIView</code> methods but haven't actually implemented any of them except <code>drawRect</code>.</p>
  
  <p>So if I repeat myself one more time - the question goes: Where to add sublayers, where to animate them and are there any tricks or catches I should be aware of?</p>