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
9
今から理解する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
410
iOSの隠されたAPIを解明し、開発効率を向上させる方法/iOSDC24
noppefoxwolf
2
720
既存アプリをvisionOS対応してリリースした話/visionOS LT vol5
noppefoxwolf
0
190
UIのブラックボックスを探る/iOSDC23
noppefoxwolf
3
4.3k
CoreGraphicsでドット絵を描こう/iOSDC22
noppefoxwolf
0
2.5k
ランタイムデバッグのススメ/iOSDC21
noppefoxwolf
1
4.6k
google/mediapipe で始めるARアプリ開発/iOSDC2020
noppefoxwolf
1
1.5k
モバイルファーストなアプリを作るためにvearがしたこと/xRDCC
noppefoxwolf
0
140
ソーシャルライブサービスにおけるデジタル化粧の仕組みと実装/iOSDC19
noppefoxwolf
4
5.5k
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Documentation Writing (for coders)
carmenintech
71
4.9k
The Language of Interfaces
destraynor
158
25k
Agile that works and the tools we love
rasmusluckow
329
21k
Gamification - CAS2011
davidbonilla
81
5.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
How GitHub (no longer) Works
holman
314
140k
The World Runs on Bad Software
bkeepers
PRO
68
11k
The Cult of Friendly URLs
andyhume
79
6.4k
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