I’m following the “iOS Tutorial (2020): How To Make Your First App” on YouTube and am enjoying it!
Im working through Chapter 4 and trying to modify my layout based on device size class. My version of XCode 13.x does not show the device class next to the device type name (e.g. iphone se), nor does it show the “Vary for Traits” button when clicking on the device type in the bottom toolbar.
The goog has not helped much. Does anyone know how to device size class in the bottom toolbar?
It’s no longer in the toolbar at the bottom. Annoying but that’s the evolutionary way of Xcode that we all have to deal with.
Trait variations are implemented on the existing constraint that is configured. By that I mean that you would have created a constraint (let’s assume the top constraint) and what you do is select that constraint and created a variation based on the size class.
Let me try to explain.
What want to do is be able to is to have the layout of the Social Squid look OK in landscape mode so lets assume that the top constraint for the Social Squid label is set to 100 points from the top.
The issue now is that the StackView containing the label and the Buttons was given constraints of centre Horizontally and Vertically but we can fix that too.
Select the vertical constraint for the StackView and tap the plus button to add a variation for the Width being Regular and the Height being Compact.
Hey! One last question. At the bottom toolbar where you select which device you want to view (e.g. iPhone 8 Plus), the previous versions of xCode would tell you which size class (e.g. wR hC). Current version does not. Is there another way to easily determine which class a particular device is in?