When using an IBDesignable component from an SPM package as a custom class in an interface builder document, it is being built for platforms other than the ones specified in the package description to render the designables. This only occurs when the IBDesignable is inside an SPM package.
To reproduce the issue:
1. Create a new swift package with the following package description (note the value for platforms).
2. Create a single source file SPMDesignableControl.swift in the Sources directory of this package.
3. Create a new Xcode project and drag this new package to the Project Navigator.
4. Add this package as a dependency in the Frameworks, Libraries, and Embedded Content section of the build target.
5. In Main.storyboard, add a UIView and set this view's Custom Class to SPMDesignableControl in the Identity Inspector.
6. Click on Editor > Refresh All Views to force the designables to render.
7. The Identity Inspector for SPMDesignableControl will show a build error, with a message expecting the existence of a tvOS product/target.
My expectation is since iOS is the only explicitly specified platform in the package description, it should not attempt to build the package sources for tvOS (or other platforms).
I've also seen multiple threads describing a similar issue with no solution:
A zip archive is attached below containing the SPM package (SPMDesignablePackage) and sample project setup (SPMDesignablePackageUser).