title: Creating custom init method for UIView to add a UILabel
body: <p>At the moment I have a custom UIView class which completes the following:</p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame
  {
      self = [super initWithFrame:frame];
      if (self) {
          // Initialization code
          [self setupView];
      }
      return self;
  }
  -(void)setupView {
      self.layer.cornerRadius = 4;
      self.layer.masksToBounds= YES;
      self.backgroundColor = [UIColor whiteColor];
      self.layer.borderWidth = 1;
      self.layer.borderColor = [UIColor lightGrayColor].CGColor;
  }
  </code></pre>
  
  <p>I also have another UIView Category that creates a new UIView and makes it so that I can use autolayout which is the following:</p>
  
  <pre><code>@implementation UIView (Autolayout)
  +(id)autolayoutView
  {
      UIView *view = [self new];
      view.translatesAutoresizingMaskIntoConstraints = NO;
      return view;
  }
  </code></pre>
  
  <p>Both are fairly simple. What I would like to do now is create a custom init method for the UIView.   </p>
  
  <p><strong>Question</strong><br>
  I would like the custom init method to be used to create a UILabel and it to the UIView. However, I would like the init method to use the UIView category that I have already created? I am sure this is fairly simple, just not sure how to complete this?</p>
  
  <p><strong>EDIT</strong><br>
  At present to create a custom autolayout view I call <code>UIView *myView = [MyCustomViewClass autoLayoutView]</code><br>
  What I would like to do is update the custom view class init method to create a label, but still have it called in the same way so that the category is being used and I get the auto layout information being called too.</p>
  
  <p><strong>EDIT 2</strong><br>
  What would be really useful is if I could pass in a parameter to determine if the <code>UIView</code> should have a <code>UILabel</code>. So a custom init method that could be called if the view should have a label. I know the code to create and add a label/constraints I am just not to sure on the subclassing/category link and creating custom init methods. As well as how this is called in conjunction with the <code>autoLayoutView</code> call? </p>