affaan-m avatar

Swift Concurrency 6 2

Swift 6.2 finally fixes the implicit background offloading problem that caused data races in earlier versions. Now async functions stay on the calling actor by default, so your MainActor code actually stays on the main thread unless you explicitly mark something @concurrent. The isolated conformance feature is the real unlock here: MainActor types can conform to protocols without compiler errors or unsafe workarounds. If you're migrating from 5.x or dealing with Sendable errors in 6.0/6.1, this is the new mental model. Enable MainActor default inference for app targets and only reach for @concurrent when profiling shows you actually need background execution.

skills.sh installs
4.9K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill swift-concurrency-6-2 --agent claude-code

Installs into .claude/skills of the current project.

Files

Swift 6.2 Approachable Concurrency

Patterns for adopting Swift 6.2's concurrency model where code runs single-threaded by default and concurrency is introduced explicitly. Eliminates common data-race errors without sacrificing performance.

When to Activate

  • Migrating Swift 5.x or 6.0/6.1 projects to Swift 6.2
  • Resolving data-race safety compiler errors
  • Designing MainActor-based app architecture
  • Offloading CPU-intensive work to background threads
  • Implementing protocol conformances on MainActor-isolated types
  • Enabling Approachable Concurrency build settings in Xcode 26

Core Problem: Implicit Background Offloading

In Swift 6.1 and earlier, async functions could be implicitly offloaded to background threads, causing data-race errors even in seemingly safe code:

// Swift 6.1: ERROR
@MainActor
final class StickerModel {
    let photoProcessor = PhotoProcessor()

    func extractSticker(_ item: PhotosPickerItem) async throws -> Sticker? {
        guard let data = try await item.loadTransferable(type: Data.self) else { return nil }

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Category
Mobile Development

More from affaan-m/everything-claude-code

All 256
1forcedotcom avatarmobile-platform-native-capabilities-integrateforcedotcom/sf-skillsBuild a Salesforce LWC that uses native mobile device capabilities — barcode scanner, biometrics, location, NFC, calendar, contacts, document scanner, geofencin4.7Kskills.sh installs
2forcedotcom avatarmobile-platform-offline-validateforcedotcom/sf-skillsReview a Lightning Web Component for **mobile offline** compatibility — the Komaci offline static analyzer that pre-primes the data graph for Salesforce Mobile 4.7Kskills.sh installs
3affaan-m avatarflutter-dart-code-reviewaffaan-m/everything-claude-codeflutter dart code review4.7Kskills.sh installs
4affaan-m avatarkotlin-ktor-patternsaffaan-m/everything-claude-codekotlin ktor patterns4.7Kskills.sh installs
5affaan-m avatarkotlin-exposed-patternsaffaan-m/everything-claude-codekotlin exposed patterns4.6Kskills.sh installs
6dpearson2699 avatardebugging-instrumentsdpearson2699/swift-ios-skillsDebug iOS apps and profile performance using LLDB, the interactive Memory Graph Debugger, and Instruments. Use for crashes, retain-cycle inspection, hangs, buil4.3Kskills.sh installs