Swift’s concurrency model introduces numerous keywords, some of which are similar in naming and purpose, often causing confusion among developers. This article examines several keywords related to cross-isolation domain passing in Swift concurrency: Sendable, @unchecked Sendable, @Sendable, sending, and nonsending, helping you understand their respective roles and use cases.

 

While Swift’s strict concurrency checking has good intentions, it significantly increases the burden on developers in many single-threaded scenarios. Developers are forced to add unnecessary Sendable, @MainActor, and other declarations to their code just to satisfy the compiler’s requirements. Swift 6.2’s new Default Actor Isolation feature will greatly improve this situation and reduce unnecessary boilerplate code. This article will introduce the Default Actor Isolation feature and point out some situations to be aware of when using it.

 

Compared to some open-source frameworks, Core Data and SwiftData, despite having Apple’s official endorsement, often leave developers helpless when exceptions occur due to their “black box” nature, making it difficult to quickly locate problems and find effective solutions. This article documents an app startup timeout incident caused by Core Data model migration, shares the solution, and deeply analyzes the underlying causes.

 

Text is heavily used in SwiftUI. Compared to its counterparts in UIKit/AppKit, Text requires no configuration and works out of the box, but this also means developers lose more control over it. In this article, I will demonstrate through a real-world case study how to accomplish seemingly “impossible” tasks with SwiftUI’s approach: finding the first view among a given set where text is not truncated, and using it as the required size.

view more: ‹ prev next ›