Fix bugs and modernize for current Swift/Apple platform versions#7
Open
Fix bugs and modernize for current Swift/Apple platform versions#7
Conversation
Bugs fixed: - 3-char hex (#FA4) now correctly expands to #FFAA44 per CSS convention - Int hex initializers now safely return nil on overflow instead of crashing - Remove always-true UInt32 range check (dead code) in 8-char branch Code quality: - Convert XColor from class to struct (value semantics, Swift 6 Sendable) - Make alpha immutable (let instead of var) - Remove redundant parentheses around conditions - Simplify validatedColor by merging sanitize+validate into one function Tests: - Update 3-char short hex test expectations to match corrected expansion - Fix misleading assertion message typos in UIColorTests Infrastructure: - Add Package.swift for Swift Package Manager support (iOS 16+, watchOS 9+, tvOS 16+, macOS 13+, visionOS 1+) - Update podspec: deployment targets, swift_version 5.9, version 0.4, add visionOS - Replace .travis.yml with GitHub Actions (macos-15/Xcode 16, arm64, SPM job) https://claude.ai/code/session_01EjH8goiJM4ynjw39WFr4QU
Xcode 16.4 dropped libarclite support below iOS 12, causing CI to fail with 'SDK does not contain libarclite'. Bump all framework targets: - iOS: 8.0 → 16.0 - tvOS: 9.0 → 16.0 - watchOS: 2.0 → 9.0 - macOS: 10.9 / 10.14 → 13.0 Test targets (iOS 12.1, tvOS 12.4) are already within range and unchanged. https://claude.ai/code/session_01EjH8goiJM4ynjw39WFr4QU
tvOS test target (XColor tvOSTests): - TVOS_DEPLOYMENT_TARGET 12.4 → 16.0 The test bundle must match the framework deployment target or the linker rejects the combination (exit code 65 build failure). iOS test target (XColorTests): - Add explicit IPHONEOS_DEPLOYMENT_TARGET = 16.0 to Debug and Release configs. Previously it inherited the project-level value of 12.1, creating a mismatch with the XColor iOS framework (16.0) that caused the test host to fail loading (exit code 70). SPM test imports (XColorTests.swift, UIColorTests.swift): - Add #if SWIFT_PACKAGE / @testable import XColor branch before the existing #if os(iOS) chain. The SPM module is named "XColor", not "XColor_iOS" / "XColor_macOS", so swift test on macOS was hitting @testable import XColor_macOS which does not exist (exit code 1). https://claude.ai/code/session_01EjH8goiJM4ynjw39WFr4QU
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.
Bugs fixed:
Code quality:
Tests:
Infrastructure:
https://claude.ai/code/session_01EjH8goiJM4ynjw39WFr4QU