title: How can I subclass CALayer to return a pre-styled layer?
body: <p>How do you subclass CALayer so that you return a layer with styling properties already set?</p>
  
  <p>So that:</p>
  
  <pre><code>MyCustomLayer *layer = [MyCustomLayer layer];
  </code></pre>
  
  <p>would create a layer with these properties;</p>
  
  <pre><code>layer.backgroundColor = sweetBackgroundColor.CGColor;
  layer.borderColor = sweetBorderColor.CGColor;
  
  layer.borderWidth = 2.0;
  layer.cornerRadius = 8.0;
  </code></pre>
  
  <p>So that I can just set its frame and add it to the tree.</p>
  
  <p>But I guess my question really could just be, how do you subclass an object so that it has properties already set at creation. Possible?</p>