I have a UIButton inside a UIView, my UIButton has constraints which I set in storyboard. Now, I want to set the center of the UIBut
UIButton
UIView
UIBut
Try .center property like
.center
myButton.center = self.view.center
You can also specify x and y If you need.
x
y
myButton.center.x = self.view.center.x // for horizontal myButton.center.y = self.view.center.y // for vertical