WWDC25 里关于 notification 有什么更新么?比如 async 支持等
Asked on 2025-07-05
1 search
在WWDC25中,关于通知的更新主要集中在Swift语言和通知类型的改进。在What’s new in Swift中,通知名称和负载现在支持具体类型,这使得编译器可以检查对象是否支持你注册的通知类型。这种具体类型消除了处理通知负载时的样板代码,并且可以在主线程上同步发布通知或在任意线程上异步发布通知。
此外,关于异步支持,通知可以通过异步消息的符合性在任意线程上异步发布。这些具体的通知类型在UIKit和Foundation等框架中可用,你也可以为自己的通知添加具体的通知类型。
如果你对Web推送通知感兴趣,Learn more about Declarative Web Push中介绍了声明式Web推送的进展,支持通过服务工作者进行可选处理,以提高通知的准确性。
这些更新为开发者提供了更强大的工具来处理通知,特别是在异步和多线程环境中。

What’s new in Swift
Join us for an update on Swift. We’ll talk about workflow improvements that make you more productive, and new and modernized library APIs for fundamental programming tasks. We’ll show examples of Swift adoption throughout more layers of the software stack. Finally, we’ll explore new language features for both improving approachability of concurrency, and achieving peak performance when you need it.

Welcome to WWDC25
There’s so much to dive into at WWDC25. Here’s a quick guide to help get you started.

Platforms State of the Union
Discover the newest advancements on Apple platforms.