UIView Extension to Center View : <p>In my viewcontroller I can center a textField with:</p>

<p><code>textField.center = CGPoint(x: view.bounds.midX, y: textField.center.y)</code></p>

<p>Why doesn't my extension work:</p>

<pre><code>extension UIView {
    func centerHorizontally() {
    self.center = CGPoint(x: self.superview!.bounds.midX, y: self.center.y)
}


// back in viewcontroller
emailField.centerHorizontally()
</code></pre>
