App Intents 的代码现在可以放在 SPM 中吗?
Asked on 06/12/2025
2 searches
是的,现在可以将 App Intents 的代码放在 Swift Package Manager (SPM) 中。根据 Explore new advances in App Intents 和 Get to know App Intents 的内容,App Intents 代码可以打包在 Swift 包和静态库中。这一功能使得在不同的目标之间共享 App Intents 类型变得更加容易。

Explore new advances in App Intents
Explore all the new enhancements available in the App Intents framework in this year’s releases. Learn about developer quality-of-life improvements like deferred properties, new capabilities like interactive app intents snippets, entity view annotations, how to integrate Visual Intelligence, and much more. We’ll take you through how App Intents is more expressive than ever, while becoming even easier and smoother to adopt. We’ll also share exciting new clients of App Intents this year like Spotlight and Visual Intelligence, and learn to write app intents that work great in those contexts.

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

Get to know App Intents
Learn about the App Intents framework and its increasingly critical role within Apple’s developer platforms. We’ll take you through a ground-up introduction of the core concepts: intents, entities, queries, and much more. You’ll learn how these pieces fit together and let you integrate your app through Apple’s devices, from software features like Spotlight and Shortcuts to hardware features like the Action button. We’ll also walk through how App Intents is your app’s gateway to integrating with Apple Intelligence going forward.