If you are using Interface builder to create & set position of your view, Select your View & do as the screenshot suggests below.
After that, click on "Add constraint" & you are done. This is just to set your view in horizontal centre. But you have to still add some more constraints. They are:
- Height
- Width
- Distance from top/bottom layout guide/view.
Let me know if you don't know how to do this.