title: How to set the frame of dynamically created button in Swift 3.0
body: <p>I need to place a round button at bottom corner of my iPhone app. As of now for iPhone 5, below code is good but for other iPhones button comes in middle. </p>
  
  <pre><code>let button = UIButton(type: .custom)
          button.frame = CGRect(x: 260, y: 500, width: 50, height: 50)
          button.layer.cornerRadius = 0.5 * button.bounds.size.width
          button.clipsToBounds = true
          button.setImage(UIImage(named:"dummy.jpg"), for: UIControlState.normal);
          button.addTarget(self, action: #selector(bankButtonPressed), for: .touchUpInside)
          view.addSubview(button)
  </code></pre>
  
  <p>So how do I set button fame dynamically so that it fits in all models of iPhone.
  I want button.frame = CGRect(x: 260, y: 500, width: 50, height: 50) - its x and y to be set dynamically so that it is always in bottom corner.
  I have attached the screenshot and this is how it looks.</p>
  
  <p><a href="https://i.stack.imgur.com/XoV2T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XoV2T.png" alt="enter image description here"></a></p>
  
  <p>Please guide on the same.</p>