Where is vary for traits button? (xcode13)

I cannot find the vary for traits button in the interface builder. Is there anyone who found the button?

Replies

The question has been raised several times on the forum, if you look for messages in Interface Builder or Xcode tags:

https://developer.apple.com/forums/thread/690726

You should file a bug report.

I finally found this:

h t t p s : / / w w w.reddit.com/r/Xcode/comments/psowtu/vary_for_traits_in_xcode_13/

which shows how to add traits (pretty well hidden):

  • Trait Variations need to be enabled in the File Inspector tab
  • After that you can manually add traits by clicking the plus next to a property (it'll use the active size class but you can modify it while creating too)

I had some issue to find which +it was, I think it is this one:

Hope that helps.

After spending an hour looking around and searching the internet and reading the official docs (which did not correspond to the current interface), I decided to restart xcode. And voilà, the pluses became visible. Saving is not enough, cleaning the build is not enough, you have to restart xcode if trait variations are active and you still don't see the buttons to create the variations.

To all who are still looking for a solution about missing vary for constraints button in Xcode 13, I have created a small YouTube tutorial to explain the way Variations for constraints work in latest Xcode 13.

Missing Vary For Traits Button in Xcode13 https://youtu.be/pZuNhxR_uRg

I hope this will help you to adapt the layout based on different device sizes and the orientation modes. Don't forget to leave a comment on this video and share with others.

Thank you so much. Happy Coding.