{"enrichment":{"faq":[{"a":"swift-concurrency-6-2 makes concurrency approachable by defaulting to single-threaded execution\u2014code runs on the caller's actor unless you explicitly mark work with @concurrent. This eliminates the implicit thread-hopping that caused data races in earlier Swift versions. You learn predictable patterns: async functions stay on their actor, MainActor inference reduces boilerplate in app targets, and isolated protocol conformances clarify which thread each method runs on.","q":"Is Swift 6.2 concurrency approachable for developers new to async?"},{"a":"swift-concurrency-6-2 guides migration by teaching the core shift: async functions no longer implicitly offload to background threads. Instead, they inherit the caller's actor context. To move CPU-intensive work off the main thread, use explicit @concurrent annotation. Resolve compiler data-race errors by adopting Sendable constraints, protecting global static variables, and applying MainActor isolation to UI types. The skill covers isolated protocol conformances so your types conform safely on the main thread.","q":"How do I migrate Swift 5 to 6.2 concurrency?"},{"a":"swift-concurrency-6-2 explains that MainActor isolation ensures code runs on the main thread. With isolated conformances, you declare that a type's protocol methods execute on MainActor without annotating each method individually. MainActor inference in app targets automatically applies this isolation to UI types, reducing boilerplate. This pattern prevents data races by guaranteeing thread safety for UI updates and main-thread-only operations.","q":"What is MainActor isolation and how does protocol conformance work?"},{"a":"swift-concurrency-6-2 teaches explicit @concurrent offloading: mark CPU-intensive functions with @concurrent to run them off the caller's actor on a background thread. This replaces the implicit thread-hopping of earlier versions. The skill covers when and how to apply @concurrent, ensuring your async functions stay on their actor by default while giving you precise control over which work runs in the background, eliminating data races.","q":"How do I use @concurrent for background work in Swift 6.2?"},{"a":"swift-concurrency-6-2 shows how single-threaded-by-default architecture prevents data races: code runs on one actor unless explicitly offloaded. Async functions inherit the caller's actor instead of jumping threads unpredictably. Sendable constraints and MainActor isolation enforce thread-safe data sharing. The compiler catches data-race errors at build time. This model replaces the implicit concurrency of earlier Swift versions, making thread safety the default rather than an afterthought.","q":"How does Swift 6.2 eliminate data races with single-threaded-by-default?"},{"a":"swift-concurrency-6-2 helps resolve common data-race errors: non-Sendable types crossing actor boundaries, unprotected global static variables, and missing MainActor annotations on UI code. The skill teaches how to apply Sendable conformances, use isolated properties, and adopt MainActor inference in app targets. Understanding these errors\u2014and the patterns to fix them\u2014is central to migrating existing projects and writing new code that compiles without data-race warnings.","q":"What compiler errors will I encounter when adopting Swift 6.2?"}],"shadow_tags":["actor-isolation","thread-safety","compile-time-safety","async-await","ui-threading","background-offload","data-race-prevention","incremental-adoption","performance-tuning","swift-evolution"],"summary_rewrite":"This skill guides you through Swift 6.2's concurrency paradigm, where code runs single-threaded by default and background work requires explicit @concurrent annotation. Learn how async functions now stay on the caller's actor, eliminating implicit thread offloading that caused data races in earlier versions. Master isolated protocol conformances for MainActor types and adopt MainActor inference to reduce boilerplate in app targets."},"files":[{"bytes":8216,"path":"skills/swift-concurrency-6-2/SKILL.md","sha256":"6e550da77791d4cc3eba9f07c9fdea1e2572a3325e2da5f94396da391dd8619a","url":"https://skillfed.io/files/xu-xiang/everything-claude-code-zh/swift-concurrency-6-2/d6258137/SKILL.md"}],"id":"xu-xiang/everything-claude-code-zh/swift-concurrency-6-2","links":{"html":"https://skillfed.io/xu-xiang/everything-claude-code-zh/swift-concurrency-6-2","md":"https://skillfed.io/xu-xiang/everything-claude-code-zh/swift-concurrency-6-2.md","repo":"https://github.com/xu-xiang/everything-claude-code-zh"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":298,"language":"JavaScript","last_updated":"2026-03-05","license":"MIT","name":"swift-concurrency-6-2","publisher":"xu-xiang","stars":1767},"relations":{"similar":[{"id":"affaan-m/ECC/swift-concurrency-6-2"},{"id":"dpearson2699/swift-ios-skills/swift-concurrency"},{"id":"rshankras/claude-code-apple-skills/concurrency"},{"id":"Dimillian/Skills/swift-concurrency-expert"},{"id":"jamesrochabrun/skills/swift-concurrency"},{"id":"CharlesWiltgen/Axiom/axiom-audit-concurrency"},{"id":"rshankras/claude-code-apple-skills/swift"},{"id":"steipete/agent-scripts/swift-concurrency-expert"},{"id":"sammcj/agentic-coding/swift-development"},{"id":"AvdLee/Swift-Concurrency-Agent-Skill/swift-concurrency"}]},"slug":{"owner":"xu-xiang","repo":"everything-claude-code-zh","skill":"swift-concurrency-6-2"},"version":"d6258137"}
