Slide 1

Slide 1 text

ࠓ͔Βཧղ͢ΔApp IntentΤίγεςϜ WWDC Recap (30min) noppe 1/37

Slide 2

Slide 2 text

noppe גࣜձࣾσΟʔɾΤψɾΤʔ ϥΠϒίϛϡχςΟࣄۀຊ෦ • Pococha ݸਓΞϓϦ։ൃऀ • vear • DAWN for mastodon 2/37

Slide 3

Slide 3 text

3/37

Slide 4

Slide 4 text

Agenda 4/37

Slide 5

Slide 5 text

Agenda 5/37

Slide 6

Slide 6 text

Agenda 6/37

Slide 7

Slide 7 text

App ΞϓϦʹ͸ɺ͍ͭ͘΋ͷΞΫγϣ ϯ͕͋Δ • ϑΝΠϧΛҠಈ͢Δ • ը૾Λճస͢Δ • ίʔώʔΛ஫จ͢Δ ͜Ε͸ਓؒ͸ཧղͰ͖Δ͕ɺγε ςϜ͔Β͸෼͔Βͳ͍ɻ 7/37

Slide 8

Slide 8 text

AppIntent Appʹ૊Έࠐ·ΕͨΞΫγϣϯ Λɺ֎෦ʹެ։ͨ͠΋ͷ ͨͩ͠ɺجຊతʹ͸୯ମͰԿ͔͕ ग़དྷΔΘ͚Ͱ͸ͳ͍ 8/37

Slide 9

Slide 9 text

9/37

Slide 10

Slide 10 text

AppEntity Appʹ૊Έࠐ·Εͨཁૉ΍֓೦Λɺ֎෦ʹެ։ͨ͠΋ͷ App IntentͷύϥϝʔλΛఆٛ͢Δͷʹඞཁ • ΞΧ΢ϯτ • ϦϚΠϯμʔͷλΠϓ • ۂ 10/37

Slide 11

Slide 11 text

γϣʔτΧοτ 11/37

Slide 12

Slide 12 text

γϣʔτΧοτ • AppIntentΛϥοϓ࣮ͯ͠ߦՄ ೳʹͯ͘͠ΕΔ • γϣʔτΧοτ.appͰγϣʔ τΧοτΛ࡞Δ͜ͱ͕Ͱ͖Δ 12/37

Slide 13

Slide 13 text

͜͜·ͰͷΤίγεςϜͷৼΓฦΓ 13/37

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

16/37

Slide 17

Slide 17 text

ը໘ભҠͷ࣮૷ func perform() async throws -> some IntentResult { Router.shared.navigate(.home) .result() } var body: some View { TabView { ... } .onReceived(router) { value in selection = value } } 17/37

Slide 18

Slide 18 text

ը໘ભҠͷ࣮૷ (iOS18) • ! URLRepresentableEntity • ! URLRepresentableEnum • ! URLRepresentableIntent extension TabTypeAppEntity: URLRepresentableEntity { static var urlRepresentation: URLRepresentation { "https://example.com/tabs/\(.id)" } } طଘͷUniversal Linkͷ࣮૷Λ࢖͍·ΘͤΔ 18/37

Slide 19

Slide 19 text

γϣʔτΧοτ • App Intentಉ࢜Λ૊Έ߹ΘͤΔ͜ͱ͕Ͱ͖Δ • AppEntityΛҧ͏ΞϓϦಉ࢜Ͱ΍ΓऔΓΛ͢Δඞཁ͕ग़ͯ͘Δ 19/37

Slide 20

Slide 20 text

! ɹTransferable AppEntity • App EntityʹΤΫεϙʔτՄೳͳλΠϓΛࢦఆͰ͖ΔΑ͏ʹͳͬͨ 20/37

Slide 21

Slide 21 text

! ɹTransferable AppEntity extension GreetingAppEntity: Transferable { static var transferRepresentation: some TransferRepresentation { DataRepresentation( exportedContentType: .png, exporting: { entity in entity.pngData() } ) } } 21/37

Slide 22

Slide 22 text

22/37

Slide 23

Slide 23 text

23/37

Slide 24

Slide 24 text

γϣʔτΧοτΛத৺ͱͨ͠ΤίγεςϜ ࡞੒ͨ͠γϣʔτΧοτ͸ɺγϣʔτΧοτΞϓϦͰ׆༻Ͱ͖Δ • γϣʔτΧοτΞϓϦ • Φʔτϝʔγϣϯ • γϣʔτΧοτΞϓϦ ΢ΟδΣοτ • ... 24/37

Slide 25

Slide 25 text

γϣʔτΧοτΛத৺ͱͨ͠ΤίγεςϜ ࡞੒ͨ͠γϣʔτΧοτ͸ɺγϣʔτΧοτΞϓϦҎ֎Ͱ΋׆༻Ͱ͖Δ • Action Button • Apple Pencil ProͷεΫΠʔζ • Assistive Touch • Spotlight • Siri • ... 25/37

Slide 26

Slide 26 text

26/37

Slide 27

Slide 27 text

ಛఆͷػೳʹApp IntentΛϥοϓͯ͠ఏڙ͢Δ 27/37

Slide 28

Slide 28 text

App IntentΛݺͼग़ͨ͢ΊͷϑϨʔζΛ༩͑Δ 28/37

Slide 29

Slide 29 text

struct OpenBookShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: PerformIntent(), phrases: [ "\(.applicationName)Λ։͍ͯ" ], shortTitle: "Open Example App", systemImageName: "apple.logo" ) } } 29/37

Slide 30

Slide 30 text

App IntentΛݺͼग़ͨ͢ΊͷUIΛ༩͑Δ 30/37

Slide 31

Slide 31 text

! Control Widget • ίϯτϩʔϧηϯλʔ • ϩοΫը໘ 31/37

Slide 32

Slide 32 text

App IntentΛݺͼग़ͨ͢ΊͷεΩʔϚΛ༩͑Δ 32/37

Slide 33

Slide 33 text

εΩʔϚ • 100छྨͷܾΊΒΕͨΞΫγϣ ϯͷ͜ͱ • ཁ͢Δʹɺ͋·ΓʹτϦοΩ ʔͳ໋ྩ͸ग़དྷͳ͍ͷͰ͸ͳ ͍͔ͱࢥ͏ ྫɿࡢ೔ҿΜͩਫͷྔͱಉ͡ਫΛ Ֆʹ͓͍͋͛ͯͯ 33/37

Slide 34

Slide 34 text

Apple Intelligence 34/37

Slide 35

Slide 35 text

Apple Intelligence 35/37

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

·ͱΊ 37/37