Misplaced views each time Xcode restarts
Solution 1:
This generally happens when you have not set the constraints properly.
Try removing all views inside the UIViewController and adding newly again along with your constraints.
Clean and run your code.
Solution 2:
One possible reason for misplaced views is: If you have used live views(IBDesignables) in storyboards then if you open the storyboard and quickly move to some other file before the IB has finished building all the live views then the the views get misplaced. The IB starts building the live views as soon as you view the story board in the editor. To fix the misplaced views, allow IB some time to finish building the storyboard by staying on the storyboard for few moments, and the misplaced views will get fixed.