This feature of Xcode has been driving me nuts. Can’t figure it out. But I think I finally cracked it. Create a new single view application and add a label.

Screen Shot 2017-01-27 at 7.32.07 AM.png

Now we are going to add another label that only shows up in an big iPad.

Screen Shot 2017-01-27 at 7.33.02 AM.png

Screen Shot 2017-01-27 at 7.33.32 AM.png

Doing this means only ipads with wR hR will be affected by these changes.

Screen Shot 2017-01-27 at 7.34.07 AM.png

So let’s make some changes. Add another label offset to the other one. Then click Done Varying.

Screen Shot 2017-01-27 at 7.35.09 AM.png

Screen Shot 2017-01-27 at 7.35.26 AM.png

OK. So now we have an ipad with two labels. And when we click but to our smaller iphones, only one label is there.

Screen Shot 2017-01-27 at 7.36.51 AM.png

Now let’s see how this works for constraints. Let’s go back to our iphone size, and then select landscape. We will not change some constraints only for landscape using the same procedure.

Screen Shot 2017-01-27 at 7.38.20 AM.png

Screen Shot 2017-01-27 at 7.39.20 AM.png

Delete the old constraints, and add some new ones.

Screen Shot 2017-01-27 at 7.40.31 AM.png

Screen Shot 2017-01-27 at 7.40.43 AM.png

And if we flip back to portrait our old constraints are still there!

Screen Shot 2017-01-27 at 7.41.24 AM.png

 

What this looks like in your ViewFinder is a whole bunch of contraints that are greyed out for other orientiations and sizes.

Screen Shot 2017-01-27 at 7.42.12 AM.png

And if you click on one you will see it’s only active for that particular size (hC)

Screen Shot 2017-01-27 at 7.42.21 AM.png

Lycka till! (Good luck)

 

 

 

Advertisements