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

Homekit on tvOS

Homekit on tvOS

HomeKit frameworkを使ったtvOSアプリ開発を通して学んだ事を簡単にまとめました。

Shingo Tamaki

June 05, 2017
Tweet

More Decks by Shingo Tamaki

Other Decks in Technology

Transcript

  1. ࢥ͍௨ΓʹϑΥʔΧεग़དྷͳ͍ ͦͷ1 λϒόʔ͔Βӈଆͷηϧ΁ͷϑΥʔΧεΛېࢭ͢Δ override func shouldUpdateFocus(in context: UIFocusUpdateContext) -> Bool

    { if let prev = context.previouslyFocusedView, String(describing:type(of: prev)) == "UITabBarButton" { return false } return true }
  2. UIFocusEnvironment Protocol UIFocusEnvironment ProtocolͷσϦήʔτϝιουͰϑΥʔΧ εΛ͏·͘ίϯτϩʔϧग़དྷΔΑ͏ʹ ࣮૷͢Δඞཁ͕͋Δɻ var preferredFocusEnvironments: [UIFocusEnvironment] func

    shouldUpdateFocus(in context: UIFocusUpdateContext) -> Bool { return ൑ఆॲཧ݁Ռ } override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) { //ϑΥʔΧε࣌ʹߦ͍͍ͨॲཧ } https://developer.apple.com/reference/uikit/ uifocusenvironment
  3. Θ͔ͬͨࣄ શͯͷϝιου͕࢖͑ΔΘ͚Ͱ͸ͳ͍ addHome(withName homeName: String, completionHandler completion: @escaping (HMHome?, Error?)

    -> Void) removeHome(_ home: HMHome, completionHandler completion: @escaping (Error?) -> Void) updatePrimaryHome(HMHome, completionHandler: (Error?) -> Void) Homeͷ࡞੒ʹݶΒͣɺRoom΍ΞΫηαϦʹ͍ͭͯ΋ಉ༷