-
Notifications
You must be signed in to change notification settings - Fork 0
Fix InlineArray macOS 26.0 availability and cross-platform API compatibility #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: qizh <[email protected]>
qizh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks correct, but should be tested though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes macOS build failures by adding missing platform availability annotations and correcting NSColor property names for AppKit compatibility.
- Adds
macOS 26.0to all@availableattributes inInlineArray+sugar.swiftto resolve compiler errors about InlineArray APIs requiring macOS 26.0+ - Updates NSColor property names in the AppKit code path from UIKit naming conventions to proper AppKit equivalents (e.g.,
.link→.linkColor)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Sources/QizhKit/Extensions/Collection+/InlineArray+sugar.swift | Added macOS 26.0 to four @available attributes for InlineArray extensions and InlineArrayCollection struct |
| Sources/QizhKit/Extensions/Color+/Color+values.swift | Corrected NSColor property names in AppKit block from UIKit conventions to AppKit-specific naming |
Co-authored-by: qizh <[email protected]>
qizh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, the code changes you’ve made look absolutely flawless. But, you know, just for the sake of not living in a world of surprises, we should definitely test them.
|
Here are concrete solutions for the failing Swift build job based on the logs: Problem SummaryYour macOS build is failing due to:
Solutions1. Remove or Replace Unavailable APIsIn
|
| API | iOS | macOS |
|---|---|---|
| hoverEffect | Supported | Unavailable |
| contextMenuPreview | Supported | Unavailable |
| UIPasteboard | Supported | NSPasteboard |
| UIColor | Supported | NSColor |
| .systemBackground | Supported | NSColor.windowBackgroundColor |
| .secondaryLabel | Supported | Color.secondary |
Applying these changes will fix the cross-platform build errors. If you want code diffs for the files involved just let me know the file and line, and I can generate them.
- @copilot fix these issues
Co-authored-by: qizh <[email protected]>
... Fixed all platform-specific API issues for macOS builds (dfc0793): LabeledValueView.swift:
AttributedString+String.swift:
ValueView.swift:
All changes use conditional compilation to ensure proper behavior on both iOS and macOS. |
Fix CI build failures for macOS targets by addressing availability annotations, NSColor property names, and platform-specific API usage.
Changes Made
1. InlineArray+sugar.swift
Updated all 4
@availableannotations from@available(iOS 26.0, *)to@available(iOS 26.0, macOS 26.0, *):2. Color+values.swift
Fixed NSColor property names in the AppKit section:
.link→.linkColor.placeholderText→.placeholderTextColor.separator→.separatorColor.opaqueSeparator→.separatorColor(using separator as fallback).lightText→ Uses.lightTextColoron macOS 14+, falls back to.textColoron older versions (using inline if-expression).darkText→.textColor3. Platform-specific API compatibility
Fixed iOS-only APIs to work on macOS using conditional compilation:
LabeledValueView.swift:
.hoverEffect()and.contextMenuPreviewin#if os(iOS)blocks (macOS uses reduced contentShape options).systemBackgroundto useColor(nsColor: .windowBackgroundColor)on macOSUIPasteboard.generalto useNSPasteboard.generalon macOS with proper API usageAttributedString+String.swift:
foregroundColor()for UIKit (UIColor parameter) and AppKit (NSColor parameter) using#if canImport(UIKit)/#elseif canImport(AppKit)guardsValueView.swift:
.secondaryLabelcolor references to use the correct platform-specific typeTesting
All changes use conditional compilation (
#if os(iOS),#elseif os(macOS),#if canImport(UIKit),#elseif canImport(AppKit)) to ensure proper compilation and behavior on both iOS and macOS platforms.Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.