title: Creating custom UIView init method with parameters
body: <p>I am looking to find out how to correctly subclass <code>UIView</code> with a custom init method passing in parameters. </p>
  
  <p>I have read the <code>UIView</code> class reference documentation here: <a href="https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html" rel="noreferrer">https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html</a></p>
  
  <p>At present the UIView is being created in the <code>UIViewController</code> and can be moved/refactored into its own subclass. Also at present the view is created completely in code and the frame is calculated by the constraints added to the view itself.</p>
  
  <p>The documentation says the following </p>
  
  <blockquote>
    <p>initWithFrame: - It is recommended that you implement this method. You can also implement custom initialization methods in addition to, or instead of, this method.</p>
  </blockquote>
  
  <p><strong>Question</strong><br>
  As I do not create a frame as a starting point for the view / neither is it loaded from a XIB what is the correct process to subclass this?  </p>
  
  <p>Would this be correct:</p>
  
  <pre><code>-(id)init {
      NSLog(@"%s",__PRETTY_FUNCTION__);
      self = [super init];
      if (self) {
          // Init code
          [self spmCustomInit];
      }
      return self;
  }
  
  -(void)spmCustomInit {
      NSLog(@"%s",__PRETTY_FUNCTION__);
  
  }
  </code></pre>
  
  <p>If this is is correct I need to further change this. When the view is being created it creates some subviews based on information. Also the layout is different based on a difficulty level. 
  <strong>Further question</strong><br>
  How do I create a further custom init method which I pass in parameters?<br>
  For example if I created a method called </p>
  
  <pre><code>spmInitWithWord:(NSString *)word difficulty:(GameTurnDifficulty)difficulty
  </code></pre>
  
  <p>How is the standard init method then called. Would I then call this custom init when creating the view initially too? <code>[[UICustomViewExample alloc] spmInitWithWord:testWord difficulty:turnDifficulty]</code>??</p>