Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SiriKit

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 SiriKit

Avatar for Motoki Narita

Motoki Narita

June 23, 2016
Tweet

More Decks by Motoki Narita

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ w ੒ాݩًʢͳΓͨ΋ͱ͖ʣ w !NP@UP@ w J04ΤϯδχΞ w ݸਓͰ΋ΧϝϥΞϓϦΛ࡞ͬͨΓ w

    88%$ߦ͚ͳ͔ͬͨͷͰDBUDI88%$ͱ͍͏ே͔࣌Β 88%$ͷ৘ใަ׵Λ͢ΔษڧձΛ88%$ͷؒຖே࣌ʹ ى͖ͯ։࠵ͯ͠·ͨ͠
  2. 4JSJ,JU%PNBJOT w "VEJPPSWJEFPDBMMJOH w 4UBSUBOBVEJPDBMM w 4UBSUBWJEFPDBMM w 4FBSDIUIFVTFS`TDBMMIJTUPSZ w

    .FTTBHJOH w 4FOEBNFTTBHF w 4FBSDIGPSNFTTBHFT w 1IPUP4FBSDI w 4FBSDIGPSQIPUPT w 1MBZBQIPUPTMJEFTIPX w 1BZNFOUT w 4FOEBQBZNFOUUPBOPUIFSVTFS w 3FRVFTUBQBZNFOUGSPNBOPUIFS VTFS w 8PSLPVUT w 4UBSUBXPSLPVU w 1BVTFBXPSLPVU w 3FTVNFBXPSLPVU w &OEBXPSLPVU w $BODFMBXPSLPVU w 3JEFCPPLJOH w (FUBMJTUPGBWBJMBCMFSJEFT w #PPLBSJEF w (FUUIFTUBUVTPGBCPPLFESJEF
  3. import Intents import IntentsExampleKit class IntentHandler: INExtension { override func

    handler(for intent: INIntent) -> AnyObject { return IntentExampleHandler() } }
  4. import Foundation import Intents public final class IntentExampleHandler: NSObject, INStartWorkoutIntentHandling,

    INEndWorkoutIntentHandling { public func resolveWorkoutName(forStartWorkout intent: INStartWorkoutIntent, with completion: (INStringResolutionResult) -> Void) { let resolutionResult = INStringResolutionResult.success(with: "Running") completion(resolutionResult) } public func confirm(startWorkout startWorkoutIntent: INStartWorkoutIntent, completion: (INStartWorkoutIntentResponse) -> Void) { let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartWorkoutIntent)) let response = INStartWorkoutIntentResponse(code: .success, userActivity: userActivity) completion(response) } public func handle(startWorkout startWorkoutIntent: INStartWorkoutIntent, completion: (INStartWorkoutIntentResponse) -> Void) { let userActivity = NSUserActivity(activityType: NSStringFromClass(INStartWorkoutIntent)) let response = INStartWorkoutIntentResponse(code: .success, userActivity: userActivity) completion(response) } }
  5. ·ͱΊ w छྨͷ*OUFOUT%PNBJOΛαϙʔτ w 4JSJ͕*OUFOUΦϒδΣΫτʹม׵ͯ͘͠ΕΔ w *OGPQMJTUʹαϙʔτ͢Δ*OUFOUΛهࡌ w 3FTPMWFͰύϥϝʔλͷόϦσʔγϣϯ $POpSNͰ֬ೝɺ

    )BOEMFͰλεΫͷ࣮ߦ w *OUFOUΛϋϯυϦϯά͢ΔϩδοΫपΓ͸&NCFEEFE 'SBNFXPSLʹ࣮૷ w ͠Ό΂Βͳ͍ͱߦ͚ͳ͍ͷͰσόοά͕΍ΓͮΒ͍
 ʢஏ͔͍ͣ͠ʣ w 65Λॻ͜͏
  6. References • https://developer.apple.com/library/prerelease/content/documentation/Intents/Conceptual/ SiriIntegrationGuide/index.html • https://developer.apple.com/library/prerelease/content/samplecode/UnicornChat/ Introduction/Intro.html#//apple_ref/doc/uid/TP40017332 • https://developer.apple.com/library/prerelease/content/documentation/Intents/Conceptual/ SiriIntegrationGuide/SiriDomains.html#//apple_ref/doc/uid/TP40016875-CH9-SW2

    • https://developer.apple.com/reference/intents • https://developer.apple.com/reference/intentsui • https://developer.apple.com/library/prerelease/content/documentation/Intents/Conceptual/ SiriIntegrationGuide/SpecifyingCustomVocabulary.html#//apple_ref/doc/uid/TP40016875- CH6-SW1 • https://developer.apple.com/videos/play/wwdc2016/217/ • https://developer.apple.com/videos/play/wwdc2016/225/