Skip to content

Fix bugs and modernize for current Swift/Apple platform versions#7

Open
jaumevn wants to merge 3 commits intomasterfrom
claude/explain-codebase-nb6wl
Open

Fix bugs and modernize for current Swift/Apple platform versions#7
jaumevn wants to merge 3 commits intomasterfrom
claude/explain-codebase-nb6wl

Conversation

@jaumevn
Copy link
Copy Markdown
Owner

@jaumevn jaumevn commented Mar 24, 2026

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

claude added 3 commits March 24, 2026 22:45
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants