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 should do it:
yourButton.frame = CGRectMake(self.view.frame.size.width/2 - yourButton.frame.size.width/2, self.view.frame.size.height/2 - yourButton.frame.size.height/2, yourButton.frame.size.width, yourButton.frame.size.height);