You want to animate the "layoutIfNeeded()" function after setting the constant on the constraint.
centerXConstraint.constant = 0
UIView.animate(withDuration: 0.2) {
self.view.layoutIfNeeded()
}
(Xcode 8, Swift 3.0)