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
12
今から理解する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
420
iOSの隠されたAPIを解明し、開発効率を向上させる方法/iOSDC24
noppefoxwolf
2
750
既存アプリをvisionOS対応してリリースした話/visionOS LT vol5
noppefoxwolf
0
190
UIのブラックボックスを探る/iOSDC23
noppefoxwolf
3
4.3k
CoreGraphicsでドット絵を描こう/iOSDC22
noppefoxwolf
0
2.6k
ランタイムデバッグのススメ/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
Git: the NoSQL Database
bkeepers
PRO
430
65k
Six Lessons from altMBA
skipperchong
28
3.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The Invisible Side of Design
smashingmag
301
51k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
A Modern Web Designer's Workflow
chriscoyier
695
190k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Unsuck your backbone
ammeep
671
58k
The World Runs on Bad Software
bkeepers
PRO
69
11k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
GitHub's CSS Performance
jonrohan
1031
460k
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