Your request is a good one.
For now, I only know of two workarounds, neither of which is all that great:
- Make
KingfisherSwiftUI
“compatible” with the other platforms/versions using#if
,#available
and the like. Then document well to clients that while it is designed to universally compile, it should not actually be expected to do anything meaningful on all platforms. - Describe to clients an environment variable they can set to choose one variant or the other (at
.v10
without the SwiftUI, or with both products at.v13
). Then query the environment in Package.swift and adjust thePackage
instance accordingly. The downside is that clients who use the non‐default won’t be able to just double‐click the package to open it in Xcode. In order to provide an environment they will have to useswift build
,generate-xcodeproj
orxcodebuild
.open .../Package.swift
might also inherit the environment if Xcode is not yet running, but I haven’t tried it.