I got a little excited about package trait support in Xcode 26.4. So I did some experimenting and ... I think it's great!

https://www.massicotte.org/blog/package-traits-in-xcode/

Package Traits in Xcode

At long last, package traits are now supported in Xcode and I think it's a big deal.

massicotte.org
@mattiem I was going to ask you what this is earlier but glad I waited until this scrolled onto screen :). Thanks!
@mattiem where do you specify which traits you want to use in Xcode? When you configure the package dependency?
@calicoding yes! Xcodes package management UI now has a new column that lets you control traits for packages that support them.
@mattiem in your first example, how is the FancyStructures trait enabled? I get the conditional dependency but not immediately clear what controls the condition
@ScottBerrevoets it is under the control of the package consumer. In Xcode, there's a UI to enable/disable traits for packages that support them. You can also do so programmatically via a Package.swift file if you aren't using Xcode.
@mattiem ah excellent. Thanks for the write up!
@ScottBerrevoets thanks for the feedback! I should clarify this, you aren’t the first to ask.
@mattiem well possible I’m holding it wrong. Looks like Xcode enables the default traits for a package even if they’re not selected in the UI. Did you have any issues with that?
@JamesTech I don’t think so. It certainly seemed like I was able to turn off all traits it if I wanted to. But I only played with it for like 30 mins…