Using your shader in Xcode
MetalForge gives you two pieces of code: a .metal file with the stitchable shader, and a SwiftUI snippet that calls it. The video below walks through dropping both into a fresh Xcode project — from creating the new Metal file all the way to seeing the shader run in the preview.
- 1Create a new Metal fileIn Xcode, File → New → File → Metal File.
- 2Paste the .metal codeCopy the Metal code from the Code tab in MetalForge and paste it into the new file.
- 3Paste the SwiftUI snippetCopy the Swift snippet and drop it into a new Swift file (or replace ContentView). The #Preview is included.
Tip: the SwiftUI snippet ends with a #Preview block, so once both files are in your target you can open the canvas and the shader renders without any extra wiring.