How to fix missing constraint while restarting xcode 7.1

172 Views Asked by At

I have made two storyboards: one for iPhone and another for iPad. To create the iPad storyboard I have used size class wRegular hRegular. After fixing all my constraint issues, it works perfectly in preview, but when I restart Xcode some constraints are misplaced.

Screen shot misplaced constraint while restart xcode

Screen shot after updating the frame

2

There are 2 best solutions below

4
On
  • The Basic concept of using Size class is whatever your Base design.it should be designed in wAny hAny.
  • Now it you want any perticular view should be displayed in perticular size class then only it can be added to that size class eg. if you want label should be displayed in iPad then you should add it wRegular hRegular Size class.As label added to wRegular hRegular it will only visible for iPad 7 not visible in iPhones.
  • So what you need to do is Redesign your StoryBoard in wAny hAny and add constraints to it.
  • You can Also refer my answer which has some description Main.Storyboard Frames Not Updated
1
On

just a suggestion , if you are using the same UI for both iPad and iPhone , better to use a single storyboard for both .