title: Button in the footer of tableview section Swift3
body: <p>I have a footer in the section of my tableView.
  I try to add a button, in the center, and after to center my button.
  I didn't find how I can center my button, I try to use view.center, or give him the width of all the parent view and after use a text align for center my button. (Personally I prefer use the second method .)
  Actually my code is this one</p>
  
  <pre><code>    override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -&gt; UIView? {
      let footerView = UIView()
      let labelMore = UIButton()
      footerView.addSubview(labelMore)
      labelMore.sizeToFit()
      labelMore.setTitle(footerText(status: "Test"), for: .normal)
      labelMore.backgroundColor = #colorLiteral(red: 0.3411764801, green: 0.6235294342, blue: 0.1686274558, alpha: 1)
      footerView.backgroundColor = #colorLiteral(red: 0.2392156869, green: 0.6745098233, blue: 0.9686274529, alpha: 1)
      //labelMore.addTarget(self, action:#selector(footerMore(sender:)), for: .touchUpInside)
  
      return footerView
  }
  </code></pre>
  
  <p>And I got, the green square is actually my button, I erase from my code labelMore.frame = footerView.frame, because that don't work <a href="https://i.stack.imgur.com/I9FWl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/I9FWl.jpg" alt="The green square is my button "></a></p>
  
  <p>edit: If my question is not clear I want center my button.</p>