Swift package with resources for iOS and tvOS

I'm in the process of converting my local frameworks to local Swift packages. Things are (mostly) working well but I'm struggling with one of the packages:

Package MyKit is used by an iOS and a tvOS app. It includes a storyboard for each platform. What is the most appropriate way to describe this in Package.swift? Xcode complains about iOS storyboards not being supported on tvOS so I moved them to their own targets, like this:

Code Block
let package = Package(
    name: "MyKit",
    defaultLocalization: "en",
    platforms: [
        .tvOS(.v13)
    ],
    products: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(
            name: "MyKit",
            targets: ["MyKit"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages this package depends on.
        .target(
            name: "MyKit",
            dependencies: [
                .target(name: "MyKit-iOS", condition: .when(platforms: [.iOS])),
                .target(name: "MyKit-tvOS", condition: .when(platforms: [.tvOS])),
            ]),
        .target(
            name: "MyKit-iOS",
            dependencies: []),
        .target(
            name: "MyKit-tvOS",
            dependencies: [])
    ]


This builds fine but it seems clunky to me (and I'm having issues accessing the Main.storyboard file from the package itself.

Replies

This also seems to break SwiftUI previews on my tvOS target. The preview fails and Xcode complains about the iOS storyboard being present and unsupported.
I have a Swift Package used by my iOS and my tvOS app. After several days trying to solved the same issue, I didn't find how to write the my package description to support iOS & tvOS storyboards.

Any advise on the way to achieve this goal ?