I have a UITextField that I want to enlarge its width when tapped on. I set up the constraints and made sure the constraint on the left has the lower priority t
UITextField
SWIFT 4.x :
self.mConstraint.constant = 100.0 UIView.animate(withDuration: 0.3) { self.view.layoutIfNeeded() }
Example with completion:
self.mConstraint.constant = 100 UIView.animate(withDuration: 0.3, animations: { self.view.layoutIfNeeded() }, completion: {res in //Do something })