Repository navigation
Conversation
watchOS is a declared platform, but the package failed to compile for it with 52 distinct errors. UIKit on watchOS has no semantic colors, no UIApplication, UIScreen or UIGraphicsImageRenderer, and SwiftUI there has no GroupBox, DisclosureGroup or rounded text field style. The label and standard colors now map to SwiftUI's own colors on watchOS, which follow the watch's system palette. Helpers without a sensible watchOS counterpart are compiled out: the background, fill, separator, link, tertiary/quaternary label and gray 2-6 colors, UIImage.resized, onAppBecomeActive/onAppResignActive and SideTabView. HPicker and VPicker need the materials of watchOS 10 and are marked accordingly. Previews that use unavailable views skip watchOS, and importing ImageIO makes heicData(compressionQuality:) work there.
watchOS was a declared platform that did not compile, and nothing noticed because CI only built for macOS. A matrix job now builds the package for iOS, tvOS, visionOS and watchOS with generic destinations, which need the SDKs but no simulator runtimes. The macOS job uses the swiftbuild build system like on the other open branches, so the workflow changes merge cleanly.
With the new job appended right after the swift test line, git could not merge this workflow with the swiftbuild change of the other open branches. Placed before test-macos, both changes merge cleanly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
watchOS 9 is a declared platform in
Package.swift, but the package did not compile for it: 52 distinct errors in 8 files. Fixing those uncovered more inLimitedTextField,SideTabViewand two previews. This PR makes the package build for watchOS. Helpers that cannot work there, or would be awkward on a watch, are compiled out, and the colors with a natural watchOS counterpart are mapped instead of removed. The other platforms are unaffected.What is available on watchOS now
Color.label,secondaryLabel.primary,.secondaryColor.systemBlue,systemGreen,systemIndigo,systemOrange,systemPink,systemPurple,systemRed,systemTeal,systemYellow,systemGray.blue,.green, …system*colors; SwiftUI's standard colors use the watch's system paletteHPicker,VPicker@available(watchOS 10.0, *)).thinMaterial/.regularMaterial, which watchOS only has from version 10UIImage.heicData(compressionQuality:)import ImageIOUnavailable on watchOS (compiled out with
#if !os(watchOS))Color.tertiaryLabel,quaternaryLabel,separator,opaqueSeparator,linkColor.systemFill…quaternarySystemFill,placeholderText,systemBackground…tertiarySystemGroupedBackground,systemGray2…systemGray6UIImage.resized(maxWidth:maxHeight:)UIGraphicsImageRenderernorUIScreenView.onAppBecomeActive(_:),onAppResignActive(_:)UIApplication; their lifecycle notifications come fromWKApplicationSideTabViewGroupBox, which watchOS does not have, and a side rail of tabs does not fit a watch screenThe
#Previews ofAsyncButton,DisclosureSection,HorizontalLabeledContentStyle,HPickerandVPickerskip watchOS, since they useGroupBox,DisclosureGroupor watchOS 10 API.LimitedTextFieldkeeps its default text field style on watchOS, as it already did on tvOS, because.roundedBorderis unavailable there.How this was verified
xcodebuild -scheme HandySwiftUI -destination 'generic/platform=watchOS' build(derived data in a scratch folder), onmainand on this branch:The remaining watchOS warnings are the same ones every platform already shows on
main(HandyRegexdeprecation, the#warningTODOs, the unused throwing task inAsyncButton).swift build(macOS) andxcodebuildfor generic iOS, tvOS and visionOS produced the same deduplicated diagnostics (file + message) as onmain, with no new warnings or errors.CI
A new matrix job
build-platformsrunsxcodebuild -scheme HandySwiftUI -destination 'generic/platform=<platform>' CODE_SIGNING_ALLOWED=NO buildfor iOS, tvOS, visionOS and watchOS, so a platform that stops compiling fails the PR. Generic destinations need the platform SDKs but no simulator runtimes, and the macos-26 runner has all four SDKs: on this PR all four jobs passed (1m25s–1m50s) without-skipMacroValidation. The macOS job uses--build-system swiftbuildlike #6 and #7. The new job is listed beforetest-macos, so this workflow merges cleanly after #6 and #7. That was checked by mergingmain← #6 ← #7 ← #8 locally: no conflicts, all five platforms build, andswift test --build-system swiftbuildpasses 35 tests.