[WWDC26] Build intelligent Siri experiences with App Schemas
이 글은 WWDC 세션의 transcript 와 영상 화면을 Claude Code 로 정리한 글이고, 실제로 쓴 날은 2026-11-25 다. code 는 세션 page 의 snippet 과 demo 화면의 것에 빠진 type 을 채워 Xcode 27.0 의 iOS 27 simulator SDK 로 type check 했다.
세션 정보
- 세션: Build intelligent Siri experiences with App Schemas
- 길이: 27분 23초
- 공개일: 2026-06-08
- 발표: Daniel Niemeyer (Software Engineer, Swift Intelligence Frameworks team)
- 코드: 세션 page 에 snippet 6개가 있고, demo 에 쓰인 UnicornChat 을 다루는 문서 Integrating your messaging app with Apple Intelligence 가 연결되어 있다
한 줄 요약
앱의 content 를 app schema 에 맞춘 AppEntity 로, action 을 app schema 에 맞춘 AppIntent 로 내놓으면 Siri 가 자연어 처리를 맡고, view annotation 과 Transferable 을 더하면 화면에 보이는 것을 다른 앱으로 넘기는 요청까지 받는다.
세션의 구성
세션은 27분이고 발표자 한 명이 UnicornChat 이라는 messaging sample 앱 하나로 끝까지 설명한다. Xcode demo 가 두 번 나오는데, 첫 번째는 schema 를 채택하는 과정이고 두 번째는 schema 를 하나만 채택했을 때 생기는 build error 를 고치는 과정이다.
| 순서 | 내용 | 발표 |
|---|---|---|
| 0:00 | Introduction | Daniel Niemeyer |
| 1:06 | What’s new in Siri | Daniel Niemeyer |
| 4:06 | Contributing content with App Entities | Daniel Niemeyer |
| 6:21 | Entity resolution and IndexedEntity | Daniel Niemeyer |
| 9:49 | Making actions available | Daniel Niemeyer |
| 12:03 | Adopting a schema domain in UnicornChat | Daniel Niemeyer |
| 15:39 | Moving content across apps | Daniel Niemeyer |
| 16:00 | Working across apps: onscreen awareness | Daniel Niemeyer |
| 21:09 | Best practices | Daniel Niemeyer |
| 24:18 | Testing your integration | Daniel Niemeyer |
| 26:21 | Next steps | Daniel Niemeyer |
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
제목 slide 다. 발표자 이름이 “Daniel Niemeyer, Software Engineer” 로 적혀 있다.
발표자는 App Intents 가 처음이면 기본을 다루는 이전 세션부터 보라고 권한다. 화면에는 WWDC25 의 Get to know App Intents 와 WWDC24 의 Bring your app’s core features to users with App Intents 가 나온다. 이 글도 AppIntent 와 AppEntity 를 한 번은 만들어 봤다는 전제로 쓴다.
Siri 의 세 가지 변화
27 release 에서 Siri 가 앱과 관련해 새로 할 수 있게 된 일은 세 가지다. 세션 전체가 이 세 가지를 순서대로 푸는 구조다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
slide 에는 세 줄이 있다. “Access content in your app’s entities”, “Take action using your app’s intents”, “Contextual awareness” 다. 오른쪽 iPhone 에는 화면의 글을 가리켜 Siri 에게 설명을 요청한 결과가 보인다.
| 능력 | 발표자가 든 요청 | 앱이 준비할 것 |
|---|---|---|
| Entity 로 content 접근 | “When and where is my next meeting?” | AppEntity 와 그 property |
| Intent 로 action 실행 | “Send my latest report to Mary” | AppIntent 와 parameter |
| 화면 문맥 이해 | “Explain this text”, “Get me reviews for this product” | view 에 entity annotation |
첫 번째 요청에서 Siri 는 앱에서 meeting 이 무엇인지, 어느 meeting 이 해당하는지, 시간과 장소 중 어느 property 를 돌려줄지를 알아야 한다. 두 번째에서 intent 는 앱이 지원하는 action, 필요한 parameter, 그리고 실행해도 안전한 때를 설명한다. 발표자의 표현으로는 언어 이해는 Siri 가 맡고 앱은 action 에만 집중한다.
Content 를 entity 로 제공하기
세 가지 능력의 중심에는 app entity 가 있다. 이 절은 entity 를 만드는 것, schema 에 맞추는 것, Siri 가 entity 를 찾게 하는 것을 차례로 다룬다.
App entity 란?
AppEntity 는 앱 안의 content 를 구조화해서 표현한 것이다. calendar 앱이면 event 하나하나가, mail 앱이면 message 하나하나가, photos 앱이면 사진과 album 이 entity 다. entity 는 세 가지를 설명한다.
- 그것이 무엇인가
- 어떻게 식별하는가
- 어느 property 가 중요한가 (제목, 날짜, 본문 같은 것)
발표자는 entity 가 새로운 data model 이 아니라는 점을 짚는다. 이미 있는 content 를 system 이 이해할 수 있게 설명하는 방법이다. 그래서 SwiftData 나 Core Data 의 model 을 바꿀 필요는 없고, model 에서 entity 로 바꿔 주는 code 만 있으면 된다.
App schema 란?
entity 를 만드는 것만으로는 Siri 가 그것을 찾거나 그것에 대해 말하지 못한다. Siri 가 “이 entity 는 어떤 종류의 것인가” 를 알려면 entity 가 AppSchema 에 맞아야 한다. app schema 는 message, contact, document 같은 흔한 개념에 대해 Siri 가 미리 가지고 있는 이해다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
왼쪽 주황색 원이 AppEntity 이고 “Properties (inputs)” 와 “Flexible” 이라고 적혀 있다. 오른쪽 파란 사각형이 AppSchema 이고 “Defined inputs” 와 “Structured for Siri” 라고 적혀 있다. 원과 사각형으로 그린 것은 일반 entity 는 모양이 자유롭고 schema 는 모양이 정해져 있다는 뜻으로 읽힌다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
UnicornChat 과 Siri 사이에 schema 가 놓여 있고, 그 안에 Contact, Conversation, Message 가 들어 있다. UnicornChat 의 명사는 이 셋이고 셋 다 schema 에 맞춘 entity 로 만들어져 있다. 그래서 “Show my last message from Flare” 나 “Open UnicornChat with Glow” 같은 요청을 Siri 가 이해한다.
code 에서는 @AppEntity(schema:) macro 를 붙인다. demo 의 MessageEntity.swift 화면과 세션 snippet 을 합치고, 화면에 안 보이는 부분을 채우면 다음과 같다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import AppIntents
import CoreSpotlight
import Foundation
@AppEnum(schema: .messages.messageType)
enum MessageType: String {
case text
case audio
static let caseDisplayRepresentations: [MessageType: DisplayRepresentation] = [
.text: "Text",
.audio: "Audio"
]
}
@AppEntity(schema: .messages.messagePerson)
struct ContactEntity {
static let defaultQuery = ContactQuery()
var id: UUID
var name: String
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(title: "\(name)")
}
}
@AppEntity(schema: .messages.conversation)
struct ConversationEntity {
static let defaultQuery = ConversationQuery()
var id: UUID
var name: String
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(title: "\(name)")
}
}
@AppEntity(schema: .messages.message)
struct MessageEntity: IndexedEntity {
static let defaultQuery = MessageQuery()
var id: UUID
// The text content of the message
@Property(indexingKey: \.textContent)
var body: AttributedString?
var author: ContactEntity
var messageType: MessageType
var isRead: Bool
var conversation: ConversationEntity
var date: Date
var subject: AttributedString?
var attachments: [IntentFile]
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(title: "\(author.name)")
}
}
MessageEntity 의 property 이름과 type 은 demo 화면에서 읽은 그대로다. 화면에는 attributes: Set<MessageAttribute> 도 있었는데 MessageAttribute 의 정의가 보이지 않아서 뺐다. ContactEntity, ConversationEntity, MessageType 의 내용과 displayRepresentation 은 직접 채웠다. .messages.messagePerson, .messages.conversation, .messages.messageType 은 SDK interface 와 demo 의 자동완성 목록에서 확인한 이름이다.
여기서 조심할 점이 있다. swiftc -typecheck 는 schema 가 요구하는 property 를 다 갖췄는지 검사하지 않는 것으로 보인다. id 만 둔 entity 로 시험했을 때 나온 error 는 displayRepresentation 누락뿐이었다. schema 에 맞는지에 대한 검사는 Xcode 의 build 단계에서 이루어진다.
AppEntity macro
@AppEntity(schema:) 는 type 을 AppEntity 에 conform 시키고 schema 와 연결한다. macro 자체는 iOS 18.0 부터 있었고, 예전 이름인 @AssistantEntity(schema:) 도 SDK 에 남아 있다. 문서는 AppEntity 에 있다.
Entity resolution 이란?
entity resolution 은 사용자가 한 말을 앱 안의 실제 entity 로 바꾸는 과정이다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
위에서 아래로 세 칸이다. “Open UnicornChat with Glow” 라는 요청, Siri 의 “Entity Resolution”, 그리고 name: Glow, id: 42 가 채워진 ContactEntity 다. Siri 는 Glow 가 특정 unicorn 을 가리킨다는 것을 알아내고, 맞는 contact 를 찾고, property 값이 채워진 entity 를 system 이 쓸 수 있게 넘긴다.
문제는 사람들이 정확한 이름으로만 묻지 않는다는 점이다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
검색어 “Windsurfing Carmel” 아래에 결과 후보가 두 묶음으로 나뉘어 있다. 왼쪽은 “The best windsurfing”, “Carmel County”, “Windsurfing lessons” 이고 오른쪽은 “windsurfing”, “Carmel”, “Windsurfing” 이다. “The best windsurfing in Carmel” 이라고 말하는 사람은 글자가 일치하는 것을 찾는 것이 아니라 의미를 말하고 있다. 이것을 받으려면 문자열 비교가 아니라 semantic search 가 필요하다.
IndexedEntity
entity resolution 을 뒷받침하는 첫 번째 방법은 IndexedEntity 채택이다. 채택하면 앱의 entity 가 system 의 semantic index 에 들어간다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
slide 의 세 줄은 “Adopt IndexedEntity for entity resolution”, “Match based on meaning”, “Content Q&A” 다. 오른쪽 iPhone 에서는 “Show the messages with Flare about movies” 라는 요청에 Siri 가 “I found a few messages with Flare about movies.” 라고 답하고 message 세 개를 보여 준다. 그 가운데에는 “La La Land” 나 “Inside Out” 처럼 영화 제목만 들어 있는 message 가 있다. “movies” 라는 글자가 없어도 찾았다는 것이 요점이다.
앞 절의 MessageEntity 가 이미 이 형태다. IndexedEntity 에 conform 하고, 검색 대상이 될 property 에 @Property(indexingKey:) 를 붙인다. indexingKey 는 Spotlight 의 CSSearchableItemAttributeSet 에서 어느 attribute 로 넣을지를 key path 로 고르는 것이고, 여기서는 message 본문을 \.textContent 에 넣는다.
발표자는 index 가 되면 Siri 가 content 를 찾는 데서 그치지 않고 그 위에서 추론해 질문에 답한다고 설명한다. 되묻는 횟수가 줄고 자연어 이해가 좋아지므로 IndexedEntity 가 가장 좋은 Siri 경험을 준다는 것이 세션의 입장이다.
IndexedEntity
AppEntity 를 Spotlight index 에 넣을 수 있게 하는 protocol 이고 iOS 18.0 부터 있다. attributeSet 을 직접 구현해서 attribute 를 채우는 방법도 있다. 문서는 IndexedEntity 에 있다.
EntityStringQuery
모든 것을 index 할 수는 없다. data 가 너무 크거나, server 에 있거나, 미리 index 하기에는 너무 자주 바뀌는 경우다. 이때는 EntityStringQuery 를 쓴다. Siri 가 사용자의 입력을 문자열로 넘겨주고, 맞는 entity 를 찾아 돌려주는 일은 앱이 한다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import AppIntents
import Foundation
import SwiftData
@Model
final class Person {
var id: UUID
var name: String
init(id: UUID = UUID(), name: String) {
self.id = id
self.name = name
}
var entity: ContactEntity {
ContactEntity(id: id, name: name)
}
}
struct ContactQuery: EntityStringQuery {
@Dependency
var modelContainer: ModelContainer
func entities(for identifiers: [UUID]) async throws -> [ContactEntity] {
let modelContext = ModelContext(modelContainer)
let descriptor = FetchDescriptor<Person>(
predicate: #Predicate { identifiers.contains($0.id) }
)
return try modelContext.fetch(descriptor).map(\.entity)
}
func entities(matching string: String) async throws -> [ContactEntity] {
let modelContext = ModelContext(modelContainer)
let predicate = #Predicate<Person> { person in
person.name.localizedStandardContains(string)
}
let descriptor = FetchDescriptor<Person>(predicate: predicate)
let matches = try modelContext.fetch(descriptor)
return matches.map(\.entity)
}
}
entities(matching:) 의 본문은 세션 snippet 그대로다. snippet 에는 modelContext 가 어디서 오는지 없어서 @Dependency 로 받은 ModelContainer 에서 만들었고, Person model 과 entities(for:) 도 직접 채웠다.
두 방법의 차이는 누가 찾느냐다.
| IndexedEntity | EntityStringQuery | |
|---|---|---|
| 찾는 주체 | system 의 semantic index | 앱의 code |
| 의미 기반 matching | 됨 | 안 됨 |
| Content 에 대한 질문 답변 | 됨 | 세션에서 언급 없음 |
| 맞는 경우 | 기기에 있고 미리 index 할 수 있는 data | 크거나, server 에 있거나, 자주 바뀌는 data |
| 앱이 얻는 것 | 적은 code | 검색 방식에 대한 완전한 통제 |
세션의 권고는 “index 할 수 있으면 IndexedEntity, 안 되면 EntityStringQuery” 다.
EntityStringQuery
문자열로 entity 를 찾는 query protocol 이고 iOS 16.0 부터 있다. entities(matching:) 하나를 더 구현한다. 문서는 EntityStringQuery 에 있다.
Action 을 intent 로 제공하기
entity 만으로는 정보일 뿐이다. 발표자는 entity 와 action 을 묶을 때 흥미로워진다고 말하고, action 을 두 단계로 나눠 설명한다. 일반 AppIntent 가 주는 것과, schema 를 채택했을 때 더 얻는 것이다.
App intent 와 schema
AppIntent 를 정의하면 그 action 은 Shortcuts, Spotlight, widget 같은 곳에 나타난다. Siri 가 없어도 사람들이 action 을 발견하고 실행할 수 있다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
위에 “Input”, 가운데에 func perform() async throws -> some IntentResult 가 든 상자, 아래에 “Output” 이 있다. action 이 무엇을 하는지 설명하고, parameter 를 정의하고, 동작을 구현하는 것이 개발자의 몫이고, 그것을 드러내고 제안하고 system 경험에 연결하는 것은 system 의 몫이다.
여기에 몇 단계를 더하면 action 을 Siri 로 가져올 수 있다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
entity 때와 같은 그림이다. 왼쪽 원이 AppIntent 이고 “Parameters (inputs)” 와 “Flexible”, 오른쪽 사각형이 AppSchema 이고 “Defined inputs” 와 “Structured for Siri” 다. 발표자는 schema 를 App Intents 의 specialization 으로 생각하라고 한다. 여전히 app intent 이지만 Siri 가 처리할 줄 아는 모양으로 다듬어진 것이다.
schema 가 정하는 것은 세 가지다.
- Siri 가 이해하는 action 의 종류
- Siri 가 기대하는 구조 (parameter 와 결과)
- 그 action 이 자연어와 연결되는 방식
그래서 “Send a message to Mary” 나 “Play my focus Playlist” 같은 명령을 Siri 가 확신을 가지고 처리한다.
App schema domain 이란?
schema 하나는 action 하나를 정의하지만 앱에는 보통 한 묶음이 필요하다. 그래서 schema 는 domain 으로 묶여 있다. domain 은 mail, photos, messages 같은 작업 분류 하나를 나타낸다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
“AppSchema domains” 라는 부제와 NEW 표시가 있고, 가운데 Apple Intelligence icon 양옆으로 domain icon 이 늘어서 있다. 왼쪽에는 folder, camera, 책, headphone, 사진, clipboard, 문서 같은 icon 이, 오른쪽에는 waveform, 메모, 말풍선, 전화, calendar, 시계, 지도 같은 icon 이 보인다.
발표자는 domain 을 앱과 Siri 사이의 계약 분류로 생각하라고 한다. domain 에 통합하면 미리 정의된 schema 묶음을 구현해서 앱의 기능에 연결하는 것이고, 그러면 Siri 는 그 domain 에서 앱에 대해 어떻게 말할지를 바로 안다.
Xcode 27.0 의 SDK interface 에서 domain 을 도입 시점으로 나누면 다음과 같다.
| 도입 | Domain |
|---|---|
| iOS 27.0, macOS 27.0, visionOS 27.0 | Messages, Audio, Reminders, Clock, Notes, Calendar, Phone, Maps |
| iOS 18.0, macOS 15.0, visionOS 2.0 | Mail, Photos, Files, Browser, Camera, Books, Journal, Reader, Presentation, Spreadsheet, WordProcessor, Whiteboard, System |
slide 오른쪽에 모여 있던 icon 이 27.0 에 새로 생긴 쪽과 맞아떨어진다. 27.0 에 생긴 domain 은 interface 에서 watchOS 와 tvOS 가 unavailable 로 표시되어 있다.
app schema 의 기본 구조는 같은 발표자의 WWDC24 세션 Bring your app to Siri 에 더 자세히 나온다.
Messages domain 의 sendMessage 채택
demo 는 UnicornChat 에 messages domain 의 sendMessage 를 붙이는 과정이다. 시작점은 또 entity 다. message 를 보내는 데 필요한 두 가지, 즉 받는 사람을 나타내는 contact 와 보낼 내용을 나타내는 message 가 이미 entity 로 있다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
Xcode 의 MessageIntents.swift 다. 위에는 typealias Recipients = [ContactEntity] 와 @UnionValue enum MessageDestination 이 있고, 30행에 message 까지 입력하자 자동완성 목록이 뜬다. 항목은 messages_message (AppEntity), messages_destination (UnionValue), messages_conversation (AppEntity), messages_messageType (AppEnum), messages_sendMessage (AppIntent), messages_draftMessage (AppIntent), messages_readReaction 과 messages_sendReaction (UnionValue), messages_messageEffect (AppEnum) 다. Xcode 가 domain 별 schema 를 전부 알고 있어서 이름만 치면 골라 넣을 수 있다.
messages_sendMessage 를 고르면 schema 가 요구하는 parameter 가 선언된 intent 틀이 들어온다. 화면에서는 MessageDestination type 을 찾지 못한다는 error 가 잠깐 보이고, 발표자가 parameter 의 type 을 앱의 type 으로 맞춘 뒤 perform() 을 채운다. 완성된 모양은 다음과 같다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import AppIntents
import Foundation
import GeoToolbox
typealias Recipients = [ContactEntity]
@UnionValue
enum MessageDestination {
case contact(ContactEntity)
case recipients(Recipients)
var persons: [ContactEntity] {
switch self {
case .contact(let contact): [contact]
case .recipients(let recipients): recipients
}
}
}
@MainActor
final class ModelManager {
func sendMessage(
toRecipientIDs: [UUID],
conversationID: UUID?,
messageText: String,
attachments: [IntentFile]
) async throws -> [UUID] { [] }
func messageEntities(for ids: [UUID]) async throws -> [MessageEntity] { [] }
func fetchRecipients(with ids: [UUID]) throws -> [ContactEntity] { [] }
}
@AppIntent(schema: .messages.sendMessage)
struct SendMessageIntent: AppIntent {
var destination: MessageDestination
var subject: AttributedString?
var content: AttributedString?
@Parameter(supportedContentTypes: [.image]) var attachments: [IntentFile]
@Parameter(supportedContentTypes: [.audio]) var audioMessage: IntentFile?
var locations: [PlaceDescriptor]
var links: [URL]
var scheduledDate: Date?
@Dependency
var model: ModelManager
func perform() async throws -> some ReturnsValue<[MessageEntity]> {
let recipientIDs = destination.persons.map(\.id)
let messageText = content.flatMap { String($0.characters) } ?? ""
let messageIDs = try await model.sendMessage(
toRecipientIDs: recipientIDs,
conversationID: nil,
messageText: messageText,
attachments: attachments
)
let messages = try await model.messageEntities(for: messageIDs)
return .result(value: messages)
}
}
SendMessageIntent 는 두 번째 demo 화면에 나온 최종 형태를 그대로 옮겼다. MessageDestination 은 화면에 case 두 개와 persons 의 선언까지만 보여서 persons 의 본문을 직접 채웠고, ModelManager 는 호출 모양에 맞춰 빈 구현으로 만들었다.
perform() 은 세 단계다. parameter 를 앱이 쓰는 값으로 바꾸고, 앱의 기존 전송 logic 에 넘기고, 새로 보낸 message 를 entity 로 돌려준다. 발표자가 강조한 것은 intent 구조를 새로 지어내지 않았다는 점이다. Siri 가 이미 아는 schema 를 채택해서 앱의 기존 logic 에 연결했을 뿐이고, 그 덕에 Siri 는 action 이 무엇을 하는지, 어떤 parameter 를 기대하는지, 빠진 것이 있으면 사용자를 어떻게 안내할지를 안다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
발표자가 iPhone 을 들고 “Send a message to Glow in UnicornChat, saying ‘What movies do you recommend?’” 라고 말한 직후다. 화면 위쪽에 “From UnicornChat: Ready to send it?” 라는 확인과 함께 받는 사람 Glow, 본문 “What movies do you recommend?”, 그리고 Cancel 과 Send button 이 떠 있다. 뒤의 Mac 에는 방금 작성한 code 가 보인다. Siri 가 entity query 로 Glow 를 찾고, intent 를 부르고, 앱을 열지 않은 채로 보낸다.
AppIntent macro
@AppIntent(schema:) 는 intent 를 schema 에 연결한다. messages domain 의 intent schema 는 SDK interface 에 sendMessage, draftMessage, editSentMessage, unsendMessage, setMessageReadStatus 다섯 개가 있다. domain 목록은 App schema domains 에, messages domain 은 Messages 에 있다.
앱 사이의 작업
지금까지는 앱 하나 안의 일이었다. 실제 요청은 앱 하나에서 시작해 다른 앱에서 이어지는 경우가 많다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
“Hey Siri, email my wife this reply from Bubbles” 라는 요청 아래에 UnicornChat icon 과 Email app icon 이 있고, UnicornChat 의 message 하나가 화살표를 따라 Email app 으로 넘어간다. 요청 문장에서 “email” 과 “this reply” 가 주황색으로 강조되어 있다.
발표자는 이 요청을 둘로 쪼갠다.
| 문장의 부분 | 필요한 능력 | 앱이 할 일 |
|---|---|---|
| “this reply from Bubbles” | Onscreen awareness | view 에 entity 를 연결 |
| “email it to my wife” | Content transfer | entity 를 Transferable 로 내보내기 |
Onscreen awareness
onscreen awareness 는 화면에 보이는 것을 system 이 이해하는 구조화된 정보에 연결하는 일이다. view 가 entity 와 연결되어 있으면 Siri 는 “this message” 나 “that conversation” 같은 지시어를 사용자가 이름을 대지 않아도 풀어낸다.
annotation 방법은 둘이고 쓰임이 다르다.
| API | 맞는 경우 | 예 |
|---|---|---|
NSUserActivity annotation | 화면에 주된 대상이 하나 | 문서 보기, message 작성 |
| View annotation | 의미 있는 항목이 여러 개 동시에 보임 | 대화 안의 message 들, list 의 항목 |
세션이 code 로 보여 준 것은 view annotation 쪽이다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
왼쪽에 List 안의 MessageRow 에 .appEntityIdentifier 를 붙인 code 가 있고, 오른쪽 iPhone 에는 Sparkles 와의 대화 화면이 있다. 말풍선 하나하나가 MessageEntity 하나와 연결된다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import AppIntents
import SwiftUI
struct Message: Identifiable {
var id: UUID
var text: String
}
struct MessageRow: View {
var message: Message
var body: some View { Text(message.text) }
}
struct ConversationView: View {
var messages: [Message]
var body: some View {
List {
ForEach(messages) { message in
MessageRow(message: message)
.appEntityIdentifier(
EntityIdentifier(
for: MessageEntity.self,
identifier: message.id
)
)
}
}
}
}
List 부분이 세션 snippet 이고 Message, MessageRow, ConversationView 는 직접 채웠다. 중요한 것은 view 에 entity 자체가 아니라 identifier 를 붙인다는 점이다. intent 에서 이미 쓰는 것과 같은 entity type 을 가리키므로, Siri 가 identifier 를 받아 defaultQuery 로 entity 를 가져올 수 있다. 이것만으로 “Edit this message” 나 “Forward the last one” 같은 앱 안의 요청이 가능해진다.
appEntityIdentifier
view 를 entity identifier 와 연결하는 SwiftUI modifier 다. SDK interface 에는 iOS 18.4 부터로 표시되어 있고, 선택 상태와 묶는 appEntityIdentifier(forSelectionType:identifier:) 도 있다. 문서는 [appEntityIdentifier(:)](https://developer.apple.com/documentation/swiftui/view/appentityidentifier%28:%29){:target=”_blank”} 에 있다.
EntityIdentifier
entity type 과 그 id 를 묶은 값이고 iOS 16.0 부터 있다. 문서는 EntityIdentifier 에 있다.
Content 내보내기
annotation 의 진짜 힘은 content transfer 와 합칠 때 나온다. content transfer 는 다른 앱이 내 entity 를 가지고 무언가를 하게 해 주는 것이고, entity 를 Transferable 로 내보내면 켜진다. “Text my wife this conversation” 이나 “Summarize this message” 가 그 예다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
왼쪽 code 는 ContactEntity 를 Transferable 로 만들고 IntentValueRepresentation(exporting: \.person) 을 돌려준다. 오른쪽 iPhone 에는 Siri 가 “Just to confirm - you’d like to FaceTime bubblesexamplecom?” 이라고 묻고 Change 와 FaceTime button 을 보여 준다. UnicornChat 의 contact 가 system 의 FaceTime action 으로 넘어간 것이다.
UnicornChat 은 ContactEntity 를 IntentPerson 으로 내보낸다. IntentPerson 은 system 이 사람을 나타낼 때 쓰는 type 이라서 전화, message, mail 같은 다른 앱의 action 이 받을 수 있다. 발표자의 말로는 앱은 그다음에 무슨 일이 일어나는지 알 필요가 없고, 자기 content 를 정확히 설명하기만 하면 된다.
세션 snippet 에는 ContactEntity 의 person property 가 없어서 직접 만들었다.
1
2
3
4
5
6
7
8
9
10
extension ContactEntity {
// 다른 앱으로 내보낼 때 쓰는 system type
var person: IntentPerson {
IntentPerson(
identifier: .applicationDefined(id.uuidString),
name: .displayName(name),
handle: nil
)
}
}
Transferable conformance 는 다음 절의 importing 과 한 곳에 써야 하므로 거기서 함께 싣는다.
Content 받기
content 가 내 앱으로 들어올 때는 경우가 둘이다. 들어온 것이 이미 앱에 있는 것을 가리키거나, 완전히 새로운 것이거나다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
가운데에 Flare 라는 이름의 IntentPerson 이 있고 “How should my app handle this?” 라는 질문이 붙어 있다. 왼쪽 갈래는 “Match existing entity” 이고 아래에 IntentValueQuery 와 Sparkles, Glow, Bubbles 가 든 목록이 흐리게 보인다. 오른쪽 갈래는 “Create new entity” 이고 아래에 IntentValueRepresentation 이 적혀 있다.
| 경우 | API | 하는 일 |
|---|---|---|
| 이미 있는 것을 고르거나 맞춰 보기 | IntentValueQuery | 들어온 값이 내 entity 중 어느 것인지 답한다 |
| 새로 만들기 | IntentValueRepresentation(exporting:importing:) | 들어온 값을 새 entity 로 바꾼다 |
IntentValueQuery 는 개념적으로 entity query 와 비슷하지만, 독립적인 entity resolution 이 아니라 intent parameter 를 채우는 데 쓰인다. 두 방법을 합친 code 는 다음과 같다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import AppIntents
import CoreTransferable
import Foundation
import SwiftData
@MainActor
final class ContactManager {
static let shared = ContactManager()
var contacts: [Person] = []
func add(importing intentPerson: IntentPerson) -> ContactEntity {
let contact = Person(importing: intentPerson)
contacts.append(contact)
return contact.entity
}
}
// Xcode 27.0 SDK 의 IntentPerson 에는 displayName 이 없어서 직접 만든다
extension IntentPerson {
var displayName: String {
switch name {
case .displayName(let value): value
case .components(let components): components.formatted()
default: ""
}
}
}
extension Person {
convenience init(importing intentPerson: IntentPerson) {
self.init(name: intentPerson.displayName)
}
}
extension ContactEntity: Transferable {
static var transferRepresentation: some TransferRepresentation {
IntentValueRepresentation(exporting: \.person, importing: { intentPerson in
await ContactManager.shared.add(importing: intentPerson)
})
}
}
struct ContactEntityQuery: IntentValueQuery {
@Dependency
var modelContainer: ModelContainer
func values(for input: [IntentPerson]) async throws -> [ContactEntity] {
let names = input.map(\.displayName)
let descriptor = FetchDescriptor<Person>()
let contacts = try ModelContext(modelContainer).fetch(descriptor)
let matches = contacts.filter { contact in
names.contains(where: { name in
contact.name.localizedStandardContains(name)
})
}
return matches.map(\.entity)
}
}
세션 snippet 과 달라진 곳이 셋 있다.
- snippet 의
input.map(\.displayName)은 그대로는 통과하지 않는다. Xcode 27.0 SDK 의IntentPerson에는displayName이라는 property 가 없고,name이.displayName(String),.components(PersonNameComponents),.unknown을 가진 enum 이다. 그래서 extension 으로displayName을 만들었다. - snippet 은 importing closure 안에서
ContactManager.shared.contacts.append(contact)를 바로 부른다.ContactManager를@MainActor로 두면@Sendableclosure 에서 직접 바꿀 수 없어서add(importing:)method 로 옮기고await로 불렀다. - snippet 의 model type 이름은
EntityStringQuery에서는Person, 여기서는Contact다. 글에서는Person하나로 맞췄다.
exporting: \.person 은 key path 그대로 통과했다. initializer 의 parameter 는 closure 지만 Swift 가 key path 를 함수로 바꿔 준다.
발표자의 정리는 간단하다. content 가 이미 앱에 있으면 resolve 하고, 없으면 import 한다. intent 와 흐름에 따라 둘 다 쓰는 앱이 많다.
IntentValueRepresentation
entity 를 system 의 intent value 로 내보내고 받는 TransferRepresentation 이다. SDK interface 에는 26.4 부터로 표시되어 있다. 문서는 IntentValueRepresentation 에 있다.
IntentValueQuery
들어온 intent value 로 앱의 값을 찾는 query 이고 26.0 부터 있다. values(for:) 하나를 구현한다. 문서는 IntentValueQuery 에 있다.
IntentPerson
system 이 사람을 나타내는 type 이고 iOS 16.0 부터 있다. identifier, name, handle, aliases, isMe, image 를 가진다. 문서는 IntentPerson 에 있다.
Schema 묶음과 Xcode 의 진단
best practice 로 발표자가 든 것은 하나의 원칙이다. schema 와 API 는 따로따로 채택할 수 있지만, 좋은 Siri 경험은 그것들이 함께 동작하는 데 달려 있다. 그리고 무엇이 빠졌는지는 도구가 알려 준다.
두 번째 demo 는 첫 번째에서 이어진다. sendMessage 만 채택한 상태에서 build 를 누른다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
build 가 실패하고 SendMessageIntent 줄에 error 가 붙는다. 문구는 “App Intents use case ‘Message Sending’ is missing the schema ‘messages.draftMessage’” 다. error 를 누르면 fix-it 이 나오는데, @AppIntent(schema: .messages.draftMessage) struct DraftMessageIntent 와 parameter 여덟 개 (destination, subject, content, attachments, audioMessage, locations, links, scheduledDate) 를 통째로 넣어 주겠다는 내용이고 오른쪽에 Apply button 이 있다.
error 문구에서 볼 것은 “use case” 라는 단위다. Xcode 는 schema 를 낱개로 보지 않고 “Message Sending” 이라는 사용 사례로 묶어서 검사한다. 앱이 Siri 로 message 를 보낼 수 있으면 초안을 만드는 방법도 있어야 하고, 확인이 필요한 경우에 특히 그렇다는 것이 발표자의 설명이다. 발표자는 이것이 compiler error 이기만 한 것이 아니라 설계에 대한 힌트라고 말한다. runtime 에 조용히 실패하는 대신 build 단계에서 드러낸다.
fix-it 을 적용하면 intent 정의와 parameter, 빈 구현이 들어오고, 여기에 앱에 맞는 부분을 채운다. 순서는 entity 연결, dependency 주입, 입력 처리, message 작성 화면 열기다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
완성된 DraftMessageIntent 다. destination 의 type 이 MessageDestination? 으로 바뀌어 있고, @Dependency 로 ModelManager 와 NavigationManager 를 받으며, perform() 위에 @MainActor 가 붙어 있다. 화면 아래쪽에 “Build Succeeded” 표시가 떠 있다.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@MainActor
final class NavigationManager {
func openCreateMessage(with recipients: [ContactEntity], text: String) {}
}
@AppIntent(schema: .messages.draftMessage)
struct DraftMessageIntent {
var destination: MessageDestination?
var subject: AttributedString?
var content: AttributedString?
var attachments: [IntentFile]
var audioMessage: IntentFile?
var locations: [GeoToolbox.PlaceDescriptor]
var links: [URL]
var scheduledDate: Date?
@Dependency
var model: ModelManager
@Dependency
var navigation: NavigationManager
@MainActor
func perform() async throws -> some IntentResult {
let recipientIDs = destination?.persons.map(\.id) ?? []
let messageText = content.flatMap { String($0.characters) } ?? ""
let recipients = try model.fetchRecipients(with: recipientIDs)
navigation.openCreateMessage(with: recipients, text: messageText)
return .result()
}
}
DraftMessageIntent 는 화면 그대로이고 NavigationManager 는 직접 채웠다. @MainActor 를 붙이기 전의 화면에는 fetchRecipients 와 openCreateMessage 줄에 “Main actor-isolated instance…” 로 시작하는 error 가 떠 있었다. 이 action 은 UI 상태를 바꾸므로 main actor 에서 돌아야 한다.
두 intent 를 나란히 놓으면 schema 가 왜 둘인지가 보인다.
| sendMessage | draftMessage | |
|---|---|---|
destination | 필수 | optional |
| 하는 일 | 앱을 열지 않고 전송 | 작성 화면을 열고 내용을 채움 |
| 결과 | 보낸 MessageEntity 배열 | 값 없음 |
| 실행 위치 | 제한 없음 | main actor |
parameter 목록은 같고 받는 사람이 없어도 되는지만 다르다. 받는 사람을 아직 못 정했거나 사용자가 보내기 전에 확인하고 싶어 하면 Siri 가 draft 쪽으로 넘길 수 있다는 뜻으로 읽힌다. 다만 Siri 가 둘 중 어느 것을 언제 고르는지는 세션에서 설명하지 않았다.
테스트 순서
schema 를 채택한 뒤의 테스트를 발표자는 네 단계로 쌓는다. 안쪽에서 바깥쪽으로, 즉 code 에서 시작해 Siri 전체 경험으로 나간다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
“Test with AppIntentsTesting” 이라는 부제와 NEW 표시가 있고, 오른쪽에 Xcode 의 test 결과 창이 있다. project 이름은 UnicornChat 이 아니라 CometCal 이고, 통과한 test 가 묶음별로 나열되어 있다.
| 단계 | 도구 | 확인하는 것 |
|---|---|---|
| 1 | AppIntentsTesting | Code. intent 를 부르고, parameter 를 넘기고, 결과를 검증한다. Siri 는 관여하지 않는다 |
| 2 | Shortcuts 앱 | Action 의 모양. parameter 가 어떻게 보이고 설정되는지 |
| 3 | Spotlight | Content. entity 가 index 되고, 찾아지고, 연결되는지 |
| 4 | Siri | Scenario. 자연어, entity resolution, 화면 문맥, 앱 사이 흐름 전체 |
AppIntentsTesting 은 intent 를 완전히 격리해서 돌리는 새 testing framework 이고, 발표자는 개발 초기에 business logic 을 검증하는 가장 빠르고 믿을 만한 방법이라고 소개한다. 자세한 내용은 Validate your App Intents adoption with AppIntentsTesting 에 있다. Xcode 27.0 의 iOS simulator platform 에 AppIntentsTesting.framework 가 들어 있고, 그 안에 AppIntentDefinition, AppEntityDefinition, IntentValueQueryDefinition 같은 type 이 있다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
Shortcuts 앱에 “Send Message” 라는 shortcut 이 열려 있고, action 한 줄에 “Send”, Content 자리, “to”, Recipients 자리가 보인다. schema 의 parameter 가 사람에게 이런 문장으로 보인다는 것을 여기서 확인한다. 발표자의 표현으로는 intent 가 무엇을 하느냐가 아니라 어떻게 설정되고 드러나느냐를 보는 단계다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
iPhone 의 Spotlight 화면이다. slide 의 목록에는 “Spotlight can test your content” 가 세 번째 줄로 추가되어 있다. Siri 가 무언가를 하려고 들기 전에 올바른 data 를 찾을 수 있는지를 여기서 먼저 확인한다. IndexedEntity 를 채택했다면 이 단계에서 index 가 실제로 채워졌는지가 드러난다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
마지막 줄 “Siri can test your scenarios” 가 더해졌고, iPhone 에서는 Siri 가 “It’s sent.” 라고 답한 뒤 Bubbles 와의 대화 화면이 보인다. 네 단계가 한 slide 에 쌓여서 순서가 그대로 checklist 가 된다.
이 순서가 쓸모 있는 이유는 실패했을 때 원인을 좁혀 주기 때문이다. Siri 에서 요청이 안 먹힐 때 Shortcuts 에서는 되는지, Spotlight 에서 entity 가 나오는지를 차례로 보면 logic, intent 의 모양, index, 자연어 이해 가운데 어디가 문제인지 갈린다.
세션의 마무리
발표자는 다음 단계 네 가지로 세션을 닫는다.
출처: WWDC26 - Build intelligent Siri experiences with App Schemas
“Next steps” slide 의 네 줄은 “Model and index your entities”, “Adopt the right AppSchema domains”, “Enable content transfer with Transferable”, “Test with Shortcuts, Spotlight, and Siri” 다. 아래에는 관련 세션 두 개가 적혀 있다.
- Explore advanced App Intents features for Siri and Apple Intelligence
- Code-along: Make your app available to Siri
발표자는 이 API 가 전부 지금 쓸 수 있는 것이고, 앱을 Siri 로 가져오는 일이 음성 지원을 더하는 데 그치지 않고 앱을 system 전체에서 더 빠르고 접근하기 쉽게 만든다고 말한다.
정리
세션에 나온 API 의 availability 를 SDK interface 에서 확인한 대로 적으면 다음과 같다. 세션은 전부 새것처럼 소개하지만 실제로 27.0 에 생긴 것은 domain 쪽이고, 뼈대는 그 전부터 있었다.
| API | 도입 |
|---|---|
@AppEntity(schema:), @AppIntent(schema:), @AppEnum(schema:), AppSchema | iOS 18.0 |
| Messages, Audio, Reminders, Clock, Notes, Calendar, Phone, Maps domain | iOS 27.0, macOS 27.0, visionOS 27.0 |
IndexedEntity, @Property(indexingKey:) | iOS 18.0 |
EntityStringQuery, EntityIdentifier, IntentPerson | iOS 16.0 |
appEntityIdentifier(_:) | iOS 18.4 |
IntentValueQuery | 26.0 |
IntentValueRepresentation | 26.4 |
| AppIntentsTesting | Xcode 27.0 에 포함 |
세션 page 의 snippet 과 Xcode 27.0 SDK 가 어긋나는 곳도 모아 둔다.
| snippet | 통과한 형태 |
|---|---|
input.map(\.displayName) | IntentPerson 에 displayName 이 없어서 name enum 을 푸는 extension 추가 |
ContactManager.shared.contacts.append(contact) 를 importing closure 에서 직접 호출 | @MainActor type 의 method 로 옮기고 await |
FetchDescriptor<Person> 과 FetchDescriptor<Contact> 가 섞여 있음 | Person 하나로 통일 |
modelContext, model.mainContext 의 출처 없음 | @Dependency 로 받은 ModelContainer 에서 생성 |
실제 프로젝트에 가져갈 점은 다음과 같다.
- 시작은 명사다. 앱의 주요 content 를
AppEntity로 만들고, 맞는 domain 이 있으면@AppEntity(schema:)로 schema 에 맞춘다. model 을 바꾸는 것이 아니라 model 에서 entity 로 가는 변환을 더하는 일이다. - 기기에 있는 data 는
IndexedEntity로 index 하고, 검색될 property 에indexingKey를 붙인다. server 에 있거나 자주 바뀌는 data 만EntityStringQuery로 돌린다. - action 은 schema 를 낱개가 아니라 use case 단위로 채택한다고 생각한다.
sendMessage를 넣으면draftMessage도 필요하다. 빠진 것은 Xcode 가 build error 와 fix-it 으로 알려 주므로, schema 하나를 넣은 뒤 바로 build 해 보는 것이 빠르다. - UI 를 여는 intent 의
perform()에는@MainActor를 붙인다. - list 의 row 에는
.appEntityIdentifier를 붙인다. 한 줄이지만 “이것”, “저것” 으로 가리키는 요청을 받는 조건이다. 화면의 주된 대상이 하나면NSUserActivity쪽이 맞다. - 다른 앱과 주고받을 entity 는
Transferable로 만들고IntentValueRepresentation으로 system type 에 대응시킨다. 들어오는 값은 이미 있는 것을 고르는 경우와 새로 만드는 경우를 나눠서IntentValueQuery와importing:중에 고른다. - 테스트는 AppIntentsTesting, Shortcuts, Spotlight, Siri 순서로 한다. Siri 에서 안 될 때 앞 단계로 거슬러 올라가면 원인이 좁혀진다.
참고자료
- App Intents (Apple Developer Documentation)
- Apple Intelligence and Siri AI (Apple Developer Documentation)
- Making actions and content discoverable by Apple Intelligence (Apple Developer Documentation)
- Making app entities available in Spotlight (Apple Developer Documentation)
- Donating your app’s data and actions to the system (Apple Developer Documentation)
- Providing contextual cues to Apple Intelligence and Siri (Apple Developer Documentation)