You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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).
Attachment: Download
Environment
Xcode 12.2 (12B45b) / Xcode 12.3 RC (12C33)
macOS 11.0.1 (20B50)
Additional Detail from JIRA
md5: 89ea42b3e6423f999fc0b2088b90c040
Issue Description:
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 theIBDesignable
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 aUIView
and set this view's Custom Class toSPMDesignableControl
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:
https://developer.apple.com/forums/thread/652552
https://developer.apple.com/forums/thread/652558
https://developer.apple.com/forums/thread/661391
https://stackoverflow.com/questions/64881772/
A zip archive is attached below containing the SPM package (
SPMDesignablePackage
) and sample project setup (SPMDesignablePackageUser
).The text was updated successfully, but these errors were encountered: