this post was submitted on 25 Jun 2025
3 points (100.0% liked)

Swift

439 readers
9 users here now

This group focus on the content related to the development of Apple Eco-system software. So feel free to share and talk about, for example;

founded 2 years ago
MODERATORS
 

NotificationCenter has long been a staple of iOS development, offering developers a flexible broadcast–subscribe mechanism. However, as Swift’s concurrency model has advanced, the traditional approach—using string-based identifiers and a userInfo dictionary—has revealed several pitfalls: thread-safety hazards, silent typos, and unsafe type casts. These issues often only surface at runtime.

To eliminate these pain points, Swift 6.2 introduces a brand-new, concurrency-safe notification protocols in Foundation: NotificationCenter.MainActorMessage and NotificationCenter.AsyncMessage. Leveraging Swift’s type system and concurrency isolation, it validates both posting and observing at compile time, completely eradicating common problems like “wrong thread” or “payload type mismatch.”

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here