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

watchOS 開発ことはじめ 〜ハッカソンで初めてwatchOS開発した話〜 @AKIBA.swift#5

5dd54329837fc6ae6d6b0ad54caddbe3?s=47 ketancho
September 27, 2016

watchOS 開発ことはじめ 〜ハッカソンで初めてwatchOS開発した話〜 @AKIBA.swift#5

5dd54329837fc6ae6d6b0ad54caddbe3?s=128

ketancho

September 27, 2016
Tweet

More Decks by ketancho

Other Decks in Programming

Transcript

  1. A K I B A . S W I F

    T # 5 ˏketancho watchOS ։ൃ͜ͱ͸͡Ί ʙϋοΧιϯͰॳΊͯwatchOS։ൃͨ͠࿩ʙ
  2. ࣗݾ঺հ !LFUBODIP ๭4*FS ɹɹ8FC"84ωΠςΟϒΞϓϦ ։ൃྺ ɹɹ"84ɿd೥ ɹɹJ04ྺɿϲ݄ ɹɹXBUDI04ྺɿ೔ؒ ɹɹˢڪΕଟ͍ͷͰ͕͢ɺࠓ೔͸͜ͷ࿩Λ͠·͢ʂ ⚽

  3. *XBUDI04ΞϓϦΛ։ൃͨ͜͠ͱ͋Δํʁ

  4. ࠓ೔͓࿩͢͠Δ͜ͱ ɾXBUDI04։ൃͨ͜͠ͱ͕ͳ͍ํ޲͚ʹɺ ɹ։ൃͷҰ࿈ͷྲྀΕΛ঺հ͍ͨ͠Ͱ͢ɻ ɾࣄલʹࢿྉΛ্͍͛ͯΔͷͰɺ ɹखݩͷ9DPEFͰૢ࡞Λ͠ͳ͕Βฉ͍͍͍ͯͨͩͯ΋ ɹΑ͍͔ͱࢥ͍·͢ɻ

  5. ࡞ͬͨ΋ͷ ɾϥΠϑϩάΛαʔόʹૹΔΞϓϦ ɾJ04ܦ༝Ͱ"1*Λݺͼग़͠ɺ ɹ%#ʹϥΠϑϩάΛ֨ೲ ɾ؀ڥ ɹɾXBUDI04J04 ɹɾ9$PEF4XJGU ͱ͍͏ͱฉ͑͜͸͍͍ͷͰ͕͢ɺ ݁ہ͸J1IPOFͰͰ͖Δ͜ͱΛ8BUDIͰߦ͑ΔΑ͏ʹ͚ͨͩ͠ 8BUDIͳΒͰ͸ͷΞϓϦΛ࡞Γ͍ͨɻ

  6. جຊͷΩ ɾXBUDI04ΞϓϦ͸J04ΞϓϦͱηοτͰಈ࡞͢Δ ɾJ1IPOFଆʹΞϓϦΛ࣮ػΠϯετʔϧ͢Δͱɺ ɹ"QQMF8BUDIଆʹ΋ΞϓϦ͕Πϯετʔϧ͞ΕΔ ͸͡Ίํ ɾJ04ΞϓϦϓϩδΣΫτΛ࡞੒ ɾ'JMF/FX5BSHFU ɹɹXBUDI04"QQMJDBUJPO8BUDI,JU"QQ

  7. ը໘ͷछྨ ɾ*OUFSGBDF$POUSPMMFS ɹɹϝΠϯը໘ɻ ɹɹJ04ͱ͸ҧ͍ɺ੍໿Λ͚ͭͯVQEBUFͯ͠ɺͱ͍͏ྲྀΕ͸ͳ͠ ɾ/PUJpDBUJPO ɹɹJ1IPOFଆʹ௨஌͕དྷͨλΠϛϯάͰɺ8BUDIଆʹ΋௨஌ ɾ(MBODFT ɹɹΞϓϦͷαϚϦը໘ ɹɹΞϓϦͷૢ࡞͸Ͱ͖ͳ͍ ɾ$PNQMJDBUJPOT

    ɹɹ࣌ؒʹ߹Θͤͯ࣌ܭͷจࣈ൫ʹ ɹɹ৘ใΛදࣔ
  8. TXJGU ֤ը໘ͷಈ͖Λ࣮૷ 7JFX$POUSPMMFSTXJGUʹ૬౰ ΞϓϦىಈ࣌ͷಈ͖Λهड़ "QQ%FMFHBUFTXJGUʹ૬౰ /PUJpDBUJPOը໘ͷ࣮૷ (MBODFը໘ͷ࣮૷ $PNQMJDBUJPOTը໘ͷ࣮૷

  9. ௨৴ ɾ8BUDI$POOFDUJWJUZ'SBNFXPSL ɹɾ#BDLHSPVOEUSBOTGFST ɹɹɹσʔλΛΩϡʔʹೖΕͯૹ৴ɻλΠϛϯά͸04࣍ୈ ɹɹɾ6TFS*OGP5SBOTGFSʢΩϡʔʹೖΕͨ΋ͷશͯΛૹ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