title: How to add UIButton as bottomView to UIView?
body: <p>I have a UIView class, and in xib also I have a MainView which is a UIView. I want to add UIButton as bottomView to the View.I need to give bottom space 16 between MainView and bottomView. How do I do it?</p>
  
  <pre><code> self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, self.MainView.bounds.size.height +30, self.MainView.bounds.size.width, 40.0)];
      [self.bottomView setBackgroundColor:[UIColor greenColor]];
  self.selectBtn= [UIButton buttonWithType: UIButtonTypeRoundedRect];
  [self.selectBtn setFrame:CGRectMake(0,20,100,40)];
  [self.selectBtn setTitle:@"Select" forState:UIControlStateNormal];
  [self.selectBtn addTarget:self action:@selector(selectButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
  [self.bottomView addSubview:self.selectBtn];
      [self addSubview:self.bottomView];
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/iynmb.png" rel="nofollow noreferrer">Expected result</a></p>
  
  <p><a href="https://i.stack.imgur.com/4XZpP.png" rel="nofollow noreferrer">Output from above code</a></p>