title: Correct way to load a Nib for a UIView subclass
body: <p>I am aware this question has been asked before but the answers are contradicting and I am confused, so please don't flame me.</p>
  
  <p>I want to have a reusable <code>UIView</code> subclass throughout my app. I want to describe the interface using a nib file.</p>
  
  <p>Now let's say it's a loading indicator view with an activity indicator in it. I would like on some event to instantiate this view and animate in to a view controller's view. I could describe the view's interface no problem programmatically, creating the elements programmatically and setting their frame inside an init method etc.</p>
  
  <p>How can I do this using a nib though? Maintaining the size given in interface builder without having to set a frame.</p>
  
  <p>I've managed to do it like this, but I'm sure it is wrong (it's just a view with a picker in it):</p>
  
  <pre><code> - (id)initWithDataSource:(NSDictionary *)dataSource {
          self = [super init];
          if (self){
              self = [[[NSBundle mainBundle] loadNibNamed:[NSString stringWithFormat:@"%@", [self class]] owner:self options:nil] objectAtIndex:0];
              self.pickerViewData = dataSource;
              [self configurePickerView];
          }
          return self;
      }
  </code></pre>
  
  <p>But I'm overwriting self, and when I instantiate it:</p>
  
  <pre><code>FSASelectView *selectView = [[FSASelectView alloc] initWithDataSource:selectViewDictionary];
      selectView.delegate = self;
  
      selectView.frame = CGRectMake(0, self.view.bottom + 50, [FSASelectView width], [FSASelectView height]);
  </code></pre>
  
  <p>I have to manually set the frame rather than have it picked up from IB.</p>
  
  <p>EDIT: I want to create this custom view in a view controller, and have access to control the view's elements. I don't want a new view controller.</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT: I Don't know if this is best practice, I'm sure it's not, but this is how I did it:</strong></p>
  
  <pre><code>FSASelectView *selectView = [[[NSBundle mainBundle] loadNibNamed:[NSString stringWithFormat:@"%@",[FSASelectView class]] owner:self options:nil] objectAtIndex:0];
      selectView.delegate = self;
      [selectView configurePickerViewWithData:ds];
      selectView.frame = CGRectMake(0, self.view.bottom + 50, selectView.width, selectView.height);
      selectView.alpha = 0.9;
      [self.view addSubview:selectView];
      [UIView animateWithDuration: 0.25 delay: 0 options:UIViewAnimationOptionAllowUserInteraction |UIViewAnimationOptionCurveEaseInOut animations:^{
                              selectView.frame = CGRectMake(0, self.view.bottom - selectView.height, selectView.width, selectView.height);
                              selectView.alpha = 1;
                          } completion:^(BOOL finished) {
                          }];
  </code></pre>
  
  <p><strong>Correct practice still wanted</strong></p>
  
  <p>Should this have been done using a view controller and init with nib name? Should I have set the nib in some UIView initialisation method in the code? Or is what I have done ok?</p>