Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
今から理解するApp Intentエコシステム/WWDC24Recap
Search
noppefoxwolf
July 01, 2024
0
2
今から理解するApp Intentエコシステム/WWDC24Recap
noppefoxwolf
July 01, 2024
Tweet
Share
More Decks by noppefoxwolf
See All by noppefoxwolf
Spice up your notifications/try!Swift25
noppefoxwolf
2
160
iOSの隠されたAPIを解明し、開発効率を向上させる方法/iOSDC24
noppefoxwolf
2
600
既存アプリをvisionOS対応してリリースした話/visionOS LT vol5
noppefoxwolf
0
180
UIのブラックボックスを探る/iOSDC23
noppefoxwolf
3
4.1k
CoreGraphicsでドット絵を描こう/iOSDC22
noppefoxwolf
0
2.4k
ランタイムデバッグのススメ/iOSDC21
noppefoxwolf
1
4.5k
google/mediapipe で始めるARアプリ開発/iOSDC2020
noppefoxwolf
1
1.5k
モバイルファーストなアプリを作るためにvearがしたこと/xRDCC
noppefoxwolf
0
130
ソーシャルライブサービスにおけるデジタル化粧の仕組みと実装/iOSDC19
noppefoxwolf
4
5.4k
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
177
52k
Site-Speed That Sticks
csswizardry
4
470
Measuring & Analyzing Core Web Vitals
bluesmoon
6
380
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
GraphQLとの向き合い方2022年版
quramy
45
14k
Transcript
ࠓ͔Βཧղ͢ΔApp IntentΤίγεςϜ WWDC Recap (30min) noppe 1/37
noppe גࣜձࣾσΟʔɾΤψɾΤʔ ϥΠϒίϛϡχςΟࣄۀຊ෦ • Pococha ݸਓΞϓϦ։ൃऀ • vear • DAWN
for mastodon 2/37
3/37
Agenda 4/37
Agenda 5/37
Agenda 6/37
App ΞϓϦʹɺ͍ͭ͘ͷΞΫγϣ ϯ͕͋Δ • ϑΝΠϧΛҠಈ͢Δ • ը૾Λճస͢Δ • ίʔώʔΛจ͢Δ ͜ΕਓؒཧղͰ͖Δ͕ɺγε
ςϜ͔Β͔Βͳ͍ɻ 7/37
AppIntent AppʹΈࠐ·ΕͨΞΫγϣϯ Λɺ֎෦ʹެ։ͨ͠ͷ ͨͩ͠ɺجຊతʹ୯ମͰԿ͔͕ ग़དྷΔΘ͚Ͱͳ͍ 8/37
9/37
AppEntity AppʹΈࠐ·Εͨཁૉ֓೦Λɺ֎෦ʹެ։ͨ͠ͷ App IntentͷύϥϝʔλΛఆٛ͢Δͷʹඞཁ • ΞΧϯτ • ϦϚΠϯμʔͷλΠϓ • ۂ
10/37
γϣʔτΧοτ 11/37
γϣʔτΧοτ • AppIntentΛϥοϓ࣮ͯ͠ߦՄ ೳʹͯ͘͠ΕΔ • γϣʔτΧοτ.appͰγϣʔ τΧοτΛ࡞Δ͜ͱ͕Ͱ͖Δ 12/37
͜͜·ͰͷΤίγεςϜͷৼΓฦΓ 13/37
AppIntentΛ࡞ͬͯΈΔ import AppIntents struct OpenAppIntent: AppIntent { static let title:
LocalizedStringResource = "ΞϓϦΛ։͘" func perform() async throws -> some IntentResult { // select tab .result() } static var openAppWhenRun: Bool = true @Parameter() var tabType: TabTypeAppEntity? } 14/37
AppIntentΛ࡞ͬͯΈΔ struct TabTypeAppEntity: AppEntity { static var typeDisplayRepresentation = .init(name:
"λϒͷछྨ") static var defaultQuery = TabTypeAppEntityQuery() let id: String let title: String var displayRepresentation: DisplayRepresentation { DisplayRepresentation(title: "\(title)") } } 15/37
16/37
ը໘ભҠͷ࣮ func perform() async throws -> some IntentResult { Router.shared.navigate(.home)
.result() } var body: some View { TabView { ... } .onReceived(router) { value in selection = value } } 17/37
ը໘ભҠͷ࣮ (iOS18) • ! URLRepresentableEntity • ! URLRepresentableEnum • !
URLRepresentableIntent extension TabTypeAppEntity: URLRepresentableEntity { static var urlRepresentation: URLRepresentation { "https://example.com/tabs/\(.id)" } } طଘͷUniversal Linkͷ࣮Λ͍·ΘͤΔ 18/37
γϣʔτΧοτ • App Intentಉ࢜ΛΈ߹ΘͤΔ͜ͱ͕Ͱ͖Δ • AppEntityΛҧ͏ΞϓϦಉ࢜ͰΓऔΓΛ͢Δඞཁ͕ग़ͯ͘Δ 19/37
! ɹTransferable AppEntity • App EntityʹΤΫεϙʔτՄೳͳλΠϓΛࢦఆͰ͖ΔΑ͏ʹͳͬͨ 20/37
! ɹTransferable AppEntity extension GreetingAppEntity: Transferable { static var transferRepresentation:
some TransferRepresentation { DataRepresentation( exportedContentType: .png, exporting: { entity in entity.pngData() } ) } } 21/37
22/37
23/37
γϣʔτΧοτΛத৺ͱͨ͠ΤίγεςϜ ࡞ͨ͠γϣʔτΧοτɺγϣʔτΧοτΞϓϦͰ׆༻Ͱ͖Δ • γϣʔτΧοτΞϓϦ • Φʔτϝʔγϣϯ • γϣʔτΧοτΞϓϦ ΟδΣοτ •
... 24/37
γϣʔτΧοτΛத৺ͱͨ͠ΤίγεςϜ ࡞ͨ͠γϣʔτΧοτɺγϣʔτΧοτΞϓϦҎ֎Ͱ׆༻Ͱ͖Δ • Action Button • Apple Pencil ProͷεΫΠʔζ •
Assistive Touch • Spotlight • Siri • ... 25/37
26/37
ಛఆͷػೳʹApp IntentΛϥοϓͯ͠ఏڙ͢Δ 27/37
App IntentΛݺͼग़ͨ͢ΊͷϑϨʔζΛ༩͑Δ 28/37
struct OpenBookShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut(
intent: PerformIntent(), phrases: [ "\(.applicationName)Λ։͍ͯ" ], shortTitle: "Open Example App", systemImageName: "apple.logo" ) } } 29/37
App IntentΛݺͼग़ͨ͢ΊͷUIΛ༩͑Δ 30/37
! Control Widget • ίϯτϩʔϧηϯλʔ • ϩοΫը໘ 31/37
App IntentΛݺͼग़ͨ͢ΊͷεΩʔϚΛ༩͑Δ 32/37
εΩʔϚ • 100छྨͷܾΊΒΕͨΞΫγϣ ϯͷ͜ͱ • ཁ͢Δʹɺ͋·ΓʹτϦοΩ ʔͳ໋ྩग़དྷͳ͍ͷͰͳ ͍͔ͱࢥ͏ ྫɿࡢҿΜͩਫͷྔͱಉ͡ਫΛ Ֆʹ͓͍͋͛ͯͯ
33/37
Apple Intelligence 34/37
Apple Intelligence 35/37
AssistantSchema ! @AssistantIntent(schema: .system.search) // Add struct ExampleSearchIntent: ShowInAppSearchResultsIntent {
static var searchScopes: [StringSearchScope] = [.general] @Parameter() var criteria: StringSearchCriteria func perform() async throws -> some IntentResult { let searchString = criteria.term print("Searching for \(searchString)") // ... return .result() } } 36/37
·ͱΊ 37/37