WWDC26 · 344Code-along: Make your app available to Siri
当前 0:07 7s官方 ↗
Session 344·Code-along: Make your app available to Siri·深度内容已验证 · 5 sections · 5 cards
深度内容已验证

视频证据

已具备 session-specific claims、anchors、evidence refs、脚本分段和 CDP 验证;这是可审核完成态。

正在接入 Apple HLS 视频源…

脚本分段

分段导航

每段对应一个视频时间段,说明“讲什么、支撑哪条洞察、对应哪些锚点”。完整字幕不在公开页复刻。

CometCal 登场——Siri 理解 app 内容的第一步:Entity + Schema

deep_candidate

Justin(Swift Intelligence Frameworks 团队)开场:Code-along 用 CometCal 演示 Siri 集成。App Schemas 描述 app 内容和动作,不需要训练短语。Xcode 自动补全 Calendar Domain snippet。CalendarEntity 用 @AppEntity macro + IndexedEntity 协议。

SirischemaApp IntentsApple Intelligencemodel
确认 App Schemas 的核心价值——无需 NLP 配置。 · source segments: 0–83

Entity query + @Dependency + Spotlight donation——内容可被发现

deep_candidate

@Dependency 注入 CalendarManager。EntityQuery + EnumerableEntityQuery 使系统通过 ID 获取实体。IndexedEntity 自动捐入 Spotlight 索引。AttendeeEntity 用 TransientAppEntity,不独立查询,通过 Event 访问。

SirimodelsearchSwiftDataApp Intents
确认 IndexedEntity vs TransientAppEntity 的选择依据。 · source segments: 84–167

EventEntity——完整的 Schema 属性集合,包括关系和 union

deep_candidate

EventEntity 包含 CalendarEntity 关系和 AttendeeEntity 数组。系统级枚举通过 snippet 自动填充。Recurrence 用 Foundation Calendar.RecurrenceRule。Location 是 union 值(PlaceDescriptor 或 String)。Siri 可搜索标题和笔记内容。

schemaSirimodelsearchCometCal
确认 Schema 属性的完整性和灵活性。 · source segments: 168–251

On-screen awareness + 创建 Intent——Siri 知道屏幕上有什么并执行操作

deep_candidate

appEntityIdentifier 连接列表到 entity。userActivity 标记当前详情页的 entity。Siri 可理解「这个」「第三个」等引用。创建事件 Intent 通过 calendar_createEvent snippet 生成,Siri 处理语义理解、澄清和确认。

SirischemaAppIntentaiAI & Machine Learning
确认 on-screen awareness 的两个 modifier。 · source segments: 252–335

更新/删除 Intent + 自定义 Siri 结果视图——完整 CRUD + 品牌化

deep_candidate

UpdateEventIntent 可选参数的 valueState(.set/.unset)区分不修改和清空。DeleteEventIntent 最简单。Siri 自动处理确认和歧义消解。ShowsSnippetView 让自定义 SwiftUI 视图替换 Siri 默认结果卡。

SiriSwiftUIAppIntentApp Intentsschema
确认 valueState 在更新 Intent 中的关键作用。 · source segments: 336–419
下左 · 时间锚点

Anchor Skeleton

0:07↗
1:34↗
2:41↗
3:46↗
5:02↗
6:11↗
7:14↗
8:39↗
9:43↗
11:04↗
12:20↗
13:51↗
15:11↗
16:24↗
17:36↗
18:48↗
20:02↗
21:21↗
22:42↗
24:10↗
下右 · 深度内容已验证

Workbench Status

I1deep_candidate

Code-along 证明 App Intents 集成门槛已大幅降低——Xcode snippet + 自动补全 + @AppEntity macro。核心工作从写胶水代码转为定义业务实体和操作。

I2deep_candidate

IndexedEntity vs TransientAppEntity 选择决定实体的生命周期和可发现性——持久实体用前者,临时实体用后者。

I3deep_candidate

On-screen awareness 只需两个 modifier 即可让 Siri 理解屏幕上下文——「这个」「第三个」等引用不再需要重复实体名称。

I4deep_candidate

更新 Intent 的 valueState(.set/.unset)解决了不修改 vs 清空的语义歧义——这是 App Intents 从简单操作走向精细控制的关键。

I5deep_candidate

344 是 App Intents 集成的动手实践入口——与 240(概念)、343(进阶)、345(新能力)和 295(测试)构成全链路。