title: Get center of any UIView in Swift
body: <p>I'm trying to write a global function that adds an activityIndicator to any view (mostly imageViews though) by calling such function.</p>
  
  <p>The function I have right now is made of:</p>
  
  <pre><code>public func addActivityIndicatorToView(activityIndicator: UIActivityIndicatorView, view: UIView){
  
      //activityIndicator configuration ...
      activityIndicator.center = view.center
      view.addSubview(activityIndicator)
      activityIndicator.startAnimating()
  }
  </code></pre>
  
  <p>But I don't get the center of the view for some reason.</p>
  
  <p>I've also tried various solutions around SO and Google, but none worked until now.</p>
  
  <p>Is there any way to get the center point and set the activityIndicator to any UIView?</p>