Programmatically Add CenterX/CenterY Constraints
Update for Swift 3/Swift 4: As of iOS 8, you can and should activate your constraints by setting their isActive property to true. This enables the constraints to add themselves to the proper views. You can activate multiple constraints at once by passing an array containing the constraints to NSLayoutConstraint.activate() let label = UILabel(frame: CGRect.zero) … Read more