The left side of the square you have is clearly at the center of the screen, so that the current code runs correctly. Below the square was the center on the X-axis need to move it to the left by half its width. That is, the code should be:
Apple recommends to use Autolayout, and not frames, and there is a reference to the Central axis: NSLayoutAttributeCenterX, NSLayoutAttributeCenterY, you can add and offset to them. Moreover, You can do this in IB (storyboard or xib) and your code with VFL (Visual Format Language).