Problem
Sources/ThemeKit/MeshGradient+Codable.swift extends Apple's MeshGradient (confirmed via Apple's docs: available iOS 18.0+ / macOS 15.0+ / tvOS 18.0+ / watchOS 11.0+) unconditionally, with no #if/availability gate, inside the core ThemeKit runtime target — the one every consumer links against regardless of whether they ever declare a meshGradients category in theme.json.
Because SPM compiles a target as one unit and enforces the package's declared platforms: floor on every dependent, this single file forces the whole package (and therefore every consumer's minimum deployment target) to iOS 18, even for projects that only use plain colors/gradients/shadows.
Suggested fix
Move mesh-gradient support out of the core target — either:
- a separate optional target/product (e.g.
ThemeKitMeshGradients) that consumers only add if they actually use the meshGradients category, or
- gate
MeshGradient+Codable.swift behind #if canImport(SwiftUI) && compiler(...)/availability so the base ThemeKit target itself doesn't require iOS 18.
One caveat worth flagging for planning purposes
Splitting this out would not bring the floor all the way down to iOS 13. I checked ThemeAdaptiveStyle+ShapeStyle.swift and Shadow.swift — both implement ShapeStyle.resolve(in:), and per Apple's docs that specific requirement is iOS 17.0+ / macOS 14.0+ (the base ShapeStyle protocol itself is iOS 13+, but resolve(in:) was added later, in the same OS generation as Color.Resolved). So the realistic floor after splitting out MeshGradient is iOS 17, not iOS 13 — still a meaningful improvement (18 → 17), just want to set accurate expectations rather than imply this change alone unlocks iOS 13.
Happy to help with either the target split or the availability gating if useful.
Problem
Sources/ThemeKit/MeshGradient+Codable.swiftextends Apple'sMeshGradient(confirmed via Apple's docs: available iOS 18.0+ / macOS 15.0+ / tvOS 18.0+ / watchOS 11.0+) unconditionally, with no#if/availability gate, inside the coreThemeKitruntime target — the one every consumer links against regardless of whether they ever declare ameshGradientscategory intheme.json.Because SPM compiles a target as one unit and enforces the package's declared
platforms:floor on every dependent, this single file forces the whole package (and therefore every consumer's minimum deployment target) to iOS 18, even for projects that only use plain colors/gradients/shadows.Suggested fix
Move mesh-gradient support out of the core target — either:
ThemeKitMeshGradients) that consumers only add if they actually use themeshGradientscategory, orMeshGradient+Codable.swiftbehind#if canImport(SwiftUI) && compiler(...)/availability so the baseThemeKittarget itself doesn't require iOS 18.One caveat worth flagging for planning purposes
Splitting this out would not bring the floor all the way down to iOS 13. I checked
ThemeAdaptiveStyle+ShapeStyle.swiftandShadow.swift— both implementShapeStyle.resolve(in:), and per Apple's docs that specific requirement is iOS 17.0+ / macOS 14.0+ (the baseShapeStyleprotocol itself is iOS 13+, butresolve(in:)was added later, in the same OS generation asColor.Resolved). So the realistic floor after splitting out MeshGradient is iOS 17, not iOS 13 — still a meaningful improvement (18 → 17), just want to set accurate expectations rather than imply this change alone unlocks iOS 13.Happy to help with either the target split or the availability gating if useful.