how to set the center in view in swift

113

childView.centerXAnchor.constraint(equalTo: parentView.centerXAnchor).isActive = true
childView.centerYAnchor.constraint(equalTo: parentView.centerYAnchor).isActive = true
childView.center = parentView.center

Comments

Submit
0 Comments