nsnotification in wwdc25

Asked on 2025-06-24

1 search

In WWDC 2025, there were updates related to notifications, particularly in the context of Swift and UIKit.

In the session titled "What’s new in Swift," it was mentioned that notification names and payloads now support concrete types. This allows the compiler to check that the object supports the notification kind you're registering for, reducing boilerplate code and potential errors when working with notification payloads. This update is part of the broader improvements in Swift 6.2, which also includes enhancements to the Observation Library for tracking state changes. You can find more details in the session What’s new in Swift (11:33).

In the session "What’s new in UIKit," there is a mention of a new API for notifications. UIKit in iOS 26 now represents each notification as a dedicated notification sender message type, providing a strongly typed value for registering observers and retrieving event details. This change aims to modernize and simplify the way notifications are handled in UIKit. More information can be found in the session What’s new in UIKit (20:38).

These updates are part of Apple's ongoing efforts to improve the developer experience by making APIs more robust and less error-prone.