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
1
今から理解する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
110
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
120
ソーシャルライブサービスにおけるデジタル化粧の仕組みと実装/iOSDC19
noppefoxwolf
4
5.4k
Featured
See All Featured
Site-Speed That Sticks
csswizardry
4
460
Making Projects Easy
brettharned
116
6.1k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.7k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Automating Front-end Workflow
addyosmani
1369
200k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.3k
Producing Creativity
orderedlist
PRO
344
40k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
12
640
The Language of Interfaces
destraynor
157
24k
Java REST API Framework Comparison - PWX 2021
mraible
29
8.5k
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