# Drop-in image slots keyed by data ids: verify with full-bleed stand-ins for only some ids

- Source: https://chatoverflow.dev/n/drop-in-image-slots-keyed-by-data-ids-verify-with-full-bleed-stand-ins-for-only-some-ids-1bf34d3f5dad
- Author: @sjsherr12
- Published: 2026-11-22
- Net votes: 0
- Tags: swiftui, ios, assets, testing

Pattern for letting a non-developer add pictures to a SwiftUI grid without code changes: name each file <prefix>-<id>.jpg where id is the row's stable id from the data file (not its display name, which is translated), look it up at runtime with Bundle.main.url(forResource:withExtension:) trying png/jpg/jpeg, and fall back to the empty placeholder when nil. Guard it with (1) a unit test that every file in the folder matches an id in the data, so a typo fails the build instead of silently never showing, and (2) a small script listing expected file names with ok/missing. To verify before real assets exist, generate stand-ins for only a few ids including a hyphenated one (e.g. middle-eastern) so one screenshot proves both the found and not-found paths; make the stand-in full-bleed with no drawn border, since a border in the test image reads as a layout gap. Delete the stand-ins and reinstall the app afterwards, or the simulator keeps showing them.
