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

Watch Kitのはまりどころ

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →
Avatar for t.goda t.goda
March 29, 2019

Watch Kitのはまりどころ

Avatar for t.goda

t.goda

March 29, 2019

More Decks by t.goda

Other Decks in Programming

Transcript

  1. APPLE WATCH ΞϓϦΛ࣮૷͢Δʹ͋ͨͬͯ ▸ ར༻͢ΔFramework͕ҟͳΔ ▸ WatchKit ͱ UIKit ▸

    ex. UIViewController͕࢖͑ͳ͍ʂʂ ▸ Ұ෦iOSͷUIͷϊ΢ϋ΢͕࢖͑ͳ͍…… ▸ ѹ౗తʹUIΤϨϝϯτ͕গͳ͍
  2. WATCH KITͱ UIKITͷࠩҟ ಛʹڻ͍ͨ΋ͷ ▸ WKInterfaceControllerͱUIViewController ▸ WKInterfaceController: WatchKit ▸

    ΠχγϟϥΠβʹcontext͕͋Δ ▸ SubviewΛ࢖ͬͨ֊૚ߏ଄ͷ͋Δͳ͠ ▸ ͦ΋ͦ΋UIViewͱ͍͏֓೦͕ͳ͍ ▸ ࣅͨΑ͏ͳ΋ͷͰWKInterfaceGroup͕͋Δ ▸ Ϋϥεઃܭతʹ͸WKInterfaceObjectͷ͕͍͔ۙ΋
  3. TABLE࡞੒ ▸ UITableView ▸ UITableViewCellΫϥεͰCellΛ࡞੒ ▸ xibϑΝΠϧͰΧελϜΫϥεΛ൚༻తʹ࡞੒Մೳ ▸ WKInterfaceTable ▸

    NSObjectΛܧঝͨ͠RowΫϥεΛ࡞੒(cellͱ͍͏֓೦͸ͳ͍) ▸ xibϑΝΠϧͰΧελϜΫϥεΛ൚༻తʹ࡞੒ෆՄ https://github.com/facebookarchive/IGInterfaceDataTable
  4. IPHONEͱͷ௨৴ ▸ جຊతʹWCSessionΛར༻ ▸ AppGroups͸᠘ ▸ iPhoneଆͰ΋WCSessionͷίʔυΛॻ͘ඞཁ͋Γ ▸ iPhoneʹ઀ଓ͞Ε͍ͯΔ͔ ▸

    ௨৴தͷActivityIndicator͸ࣗલͰ࡞Δඞཁ͕͋Δ ▸ Appleᐌ͘ʮInteractions with your app should be quick. A responsive app provides a complication and keeps its snapshot up-to-date. It minimizes the time it takes to launch and load new screens. ʯ
  5. PUSH௨஌ ▸ iPhone͕ى͖͍ͯΔঢ়ଶͩͱWatchଆʹ͸௨஌͕ಧ͔ͳ͍ ௨஌λΠϓ ૹΓݩ ಧ͘ઌ ϩʔΧϧ iOS app iPhone͕ϩοΫ͞Ε͍ͯΕ͹

    Watchʹɺͦ͏Ͱͳ͚Ε͹ iPhoneʹಧ͘ ϩʔΧϧ WatchKit Extension (Watch app) Apple Watchʹ͔͠ಧ͔ͳ͍ ϦϞʔτ αʔό iPhone͕ϩοΫ͞Ε͍ͯΕ͹ Watchʹɺͦ͏Ͱͳ͚Ε͹ iPhoneʹಧ͘ αΠϨϯτ αʔό iPhoneʹ͔͠ಧ͔ͳ͍
  6. ·ͱΊ ▸ iOSΞϓϦͰ׳ΕͯΔ͔Β·͊େৎ෉΍ΖʙʢųŽ ▸ ࢮʹ·͢ ▸ ݴޠͱIDE͕ڞ௨ͯ͠Δ͚ͩͷผ෺ ▸ ࢖͑Δϊ΢ϋ΢ ▸

    ౰વ͕ͩSwiftͰͰ͖Δ͜ͱ͸ڞ௨ ▸ ࢖͑ͳ͍ϊ΢ϋ΢ ▸ UIपΓ ▸ σβΠφʔͱΑ͘࿩ͦ͏ͳʂ