There was a pitch recently in on the Swift Evolution open source forums by Ashley Garland that related to this kind of setup - the idea being the documentation catalog could contain a specific set of swift snippets, and the compiler (or SwiftPM in this case I think) could/would build those to verify that everything kept working, no warnings, etc.
I don't know the current state of that pitch, but I think it's nearly exactly what you're after here.
(and I'm doing the same right now - including snippets in two places, one in my tests, and another in the doc comments)
Post
Replies
Boosts
Views
Activity
UPDATE: I had trouble getting the structure to reflect when I posted it inside the struct's source comments, but that does work, and an extension file isn't required.
Absolutely - super minimal Xcode sample code in it's own repo: https://github.com/heckj/skyboxSampleRealityKit/
I assembled this project using Xcode 16 beta 5
Thank you,I appreciate you poking at this.
When i build and run it with Xcode 15.4, it's all good. The image I see is the one I expected, but when I built and run that same project with Xcode 16 beta 5, or the newer project, I get the fall-through/default lighting image instead. The resource IS embedded
Yeah, in the Xcode 16 beta 5 case, the error I'm printing to my local console is:
Unable to load resource: Reality File version 11 is not supported. (Latest supported version is 9.)
I also have an Xcode 16.1 beta 1 installed (but haven't tried using it in these experiments), so unclear if that is impacting the result. I'm not sure what the Reality File version is that's getting generated, or how to look - I'm guessing the embedded resource was compiled from the skybox directory.