I want to move a button to the center of the screen by code. I saw somewhere it is just few lines of code, but could not find them.
This centers the button in its superview:
CGRect bounds = button.superview.bounds; button.center = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));