title: Center a UILabel of a UIView
body: <p>I am currently trying to make a simple pop up, here I have a button, once it gets tapped.</p>
  
  <p>It should show a simple view above it, I achieved the <code>blue background</code>, but I am not being able to add a label to it, and center the <code>label</code> to the <code>blue popup</code></p>
  
  <pre><code>let width = (sender as! UIButton).frame.width
  let y = (sender as! UIButton).frame.origin.y
  let x = (sender as! UIButton).frame.origin.x
  
  myView = UIView(frame: CGRect(x: x, y: y - 30, width:width, height: 30))
  myView.backgroundColor = UIColor.blue
  
  let label = UILabel()
  label.text = (sender as! UIButton).titleLabel?.text
  label.font = UIFont(name:"avenirNext-Meduim",size:20)
  label.center = self.myView.center
  myview.addSubview(label)
  self.view.addSubview(myView)
  
  UIView.animate(withDuration: 0.1, delay: 0.1, options: [], animations: {
  
      self.myView.alpha = 0.0
  
  }) { (finished: Bool) in
  
      self.myView.isHidden = true
  }
  </code></pre>