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
11
今から理解する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
730
既存アプリを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
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
GitHub's CSS Performance
jonrohan
1031
460k
Side Projects
sachag
455
42k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
940
Balancing Empowerment & Direction
lara
1
360
Agile that works and the tools we love
rasmusluckow
329
21k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Visualization
eitanlees
146
16k
What's in a price? How to price your products and services
michaelherold
246
12k
Bash Introduction
62gerente
614
210k
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