Skip to content

Audit project for latest Swift toolchain (6.3.x) - #149

Draft
zmian wants to merge 14 commits into
mainfrom
cursor/audit-swift-633-support-61e0
Draft

Audit project for latest Swift toolchain (6.3.x)#149
zmian wants to merge 14 commits into
mainfrom
cursor/audit-swift-633-support-61e0

Conversation

@zmian

@zmian zmian commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Audits the project for the latest Swift toolchain (6.3.x) with an iOS 26 deployment baseline, prioritizing correctness over diff size. Covers manifests, access-level imports, dead backward-compat scaffolding, and source-level adoption of current standard library / SwiftUI APIs. Verified end-to-end on CI (macos-26, latest stable Xcode): Build, Test, Lint all green.

Toolchain / manifests

  • Package.swift: swift-tools-version:6.3, swiftLanguageModes: [.v6], enabled MemberImportVisibility on both targets.
  • Resources/Package.swift: swift-tools-version:6.3.
  • Xcore.xcodeproj/project.pbxproj: aligned LastSwiftUpdateCheck and IPHONEOS_DEPLOYMENT_TARGET (26.0).
  • README.md: generic "latest SDK/Xcode/Swift" wording.

Access-level imports (SE-0409)

  • Adopted explicit public import alongside @_exported in Xcore.swift and the Example Exports.swift.
  • Added missing direct imports surfaced by MemberImportVisibility (Foundation, Combine, private import SDWebImage, internal import Contacts, plus Foundation/UIKit in several tests).

Dead availability scaffolding (iOS 26 baseline)

  • Removed redundant @available(iOS <26) annotations: Mutex+Extensions, AsyncSequence+Extensions, NotificationCenter+Extensions, Clock+DispatchSourceTimer, Divided.
  • Collapsed dead if #available(iOS 18, *) runtime branches (removing unreachable else fallbacks): UIHostingWindow, Date+Extensions, Date+Formatted, DynamicTextFieldPreviews.

Modern stdlib / SwiftUI adoption

  • Removed custom Collection.count(where:) — now provided by the stdlib Sequence.count(where:) (Swift 6.0+) with O(1) space vs the old filter().count.
  • DeviceSafeAreaInsetsProviderModifier: replaced GeometryReader with onGeometryChange, avoiding GeometryReader's layout side effects.
  • Replaced deprecated single-argument SwiftUI .cornerRadius(_:) (deprecated iOS 17) with the repo's cornerRadius(_:style:) wrapper (PopupPreviews, BoundedView).

Intentionally left alone (with rationale)

  • Publisher+Extensions.swift keeps NSRecursiveLock — it is reentrant by design; a non-reentrant Mutex would deadlock.
  • DynamicTextFieldStyle keeps its manual @preconcurrency EnvironmentKey — its default is @MainActor-isolated, which the @Entry macro cannot express.
  • Screen/Device stay on ObservableObject — they carry no stored observable state and signal via objectWillChange on orientation change, which @Observable's access-tracking model would break.
  • Collection+Sort keypath helpers keep their hand-rolled bodies — the optional-keypath variant has bespoke nil-ordering that KeyPathComparator would not preserve.
  • AnyCodable retained; no built-in Foundation equivalent is currently superior.
  • SystemAssetIdentifier+Symbols+NN.swift keep their @available markers documenting each SF Symbol's introduction version.

Follow-ups that need maintainer intent (not included)

These are correctness-relevant but change behavior/API and can't be validated without a device/design decision:

  • Migrate off deprecated UIKit globals: UIScreen.main (Screen), delegate window + barTintColor/appearance (Theme+Configure), statusBarFrame (Constants).
  • Optional GCD → structured-concurrency hops in @MainActor types (InactivityMonitor, ImageView).
Open in Web Open in Cursor 

cursoragent and others added 11 commits July 7, 2026 02:11
Update the hidden Resources package manifest to Swift tools 6.3, align Xcode
project deployment metadata with the package's iOS 26 baseline, and avoid
hard-coded version churn in README requirements.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Make intentional re-exports explicit with public import access and enable
MemberImportVisibility for the package and tests.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires files to import the module that defines member
APIs they use; Meta.swift uses Foundation string replacement options.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires files using Publisher.values to import Combine
directly instead of relying on transitive imports.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires files using SDWebImage UIImageView extensions to
import SDWebImage directly.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires files using CNPostalAddress members to import
Contacts directly.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires tests using Locale.Region static members to
import Foundation directly.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires tests to import UIKit/Foundation for UIColor and
Foundation-backed literal/member APIs they use.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
MemberImportVisibility requires validation tests using Foundation-backed rule
members to import Foundation directly.

Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
@cursor cursor Bot changed the title Align project metadata with latest Swift toolchain Audit project for latest Swift toolchain (6.3.x) Jul 7, 2026
cursoragent and others added 3 commits July 7, 2026 06:22
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
Co-authored-by: Zeeshan Mian <zmian@users.noreply.github.com>
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