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

iOS でポエムをつづろう!

iOS でポエムをつづろう!

[Conference With Developers 2](http://confwd2.peatix.com)
LT 発表資料

Satoshi Ebisawa

February 01, 2014
Tweet

More Decks by Satoshi Ebisawa

Other Decks in Technology

Transcript

  1. 2014-02-01 Conference With Developers 2
    iOS ͰϙΤϜΛͭͮΖ͏ʂ
    ւ࿝୔ ૱ (@satococoa) Yokohama.rb / RubyMotion JP / P4D

    View full-size slide

  2. ΞδΣϯμ
    ✤ ϙΤϜͱ͸!
    ✤ ωΠςΟϒͱ Web ͱͷڱؒʹͯͷᷤ౻!
    ✤ ͜͜Ζ͕͚!
    ✤ RESTful ͳઃܭʹର͢ΔಌΕ

    View full-size slide

  3. ϙΤϜͱ͸
    bit.ly/inu-poem

    View full-size slide

  4. ωΠςΟϒͱ Web ͷڱؒʹͯͷᷤ౻
    ✤ ϙΤϜ͸ Web ΞϓϦ!
    ✤ ϋΠϒϦου vs ϑϧωΠςΟϒ!
    ✤ ҆қʹϋΠϒϦουΛબͿͱٽ͘ (Web ԰͋Δ͋Δ)

    View full-size slide

  5. ϙΤϜΞϓϦʹཉ͍͠΋ͷ
    ✤ ϙΤϜͷొ࿥ɾߋ৽ΛωΠςΟϒ UI Ͱ!
    ✤ ௨஌͸ HBFav2 Έ͍ͨͳ੩͔ͳ Push ͕ཉ͍͠!
    ✤ ͔Θ͍Β͠͞

    View full-size slide

  6. ϙΤϜ։ൃνʔϜ
    ✤ Ruby ਥ × ਺໊ + σβΠφ × 1໊ + iOS × 1 ໊!
    ✤ ΍ͨΒ։ൃૣ͍ɻUI ͪΐͪ͘ΐ͘มΘΔɻ!
    ✤ ·ͩϦϦʔε͔Β͕࣌ؒܦ͍ͬͯͳ͍ɻ

    View full-size slide

  7. ΑΖ͍͠ɺͳΒ͹ϋΠϒϦουͩ
    ✤ ཉ͍͠ػೳ͸͋·ΓෳࡶͰ͸ͳ͍!
    ✤ WebView Λ૊ΈࠐΉํ͕νʔϜͷྗΛ׆͔ͤΔ!
    ✤ JavaScript ʹۤखҙࣝ͸ͳ͍

    View full-size slide

  8. ͜͜Ζ͕͚
    ✤ Web ͷ։ൃͷअຐʹͳΒͳ͍Α͏ʹ͢Δ!
    ✤ ϋΠϒϦουʹىҼ͢Δෳࡶ͕͞ҰఆൣғΛӽ͑ͨΒ
    ϑϧωΠςΟϒʹ͢Δ!
    ✤ ߦّͷྑ͍ઃܭΛߦ͏

    View full-size slide

  9. ྫʣωΠςΟϒ౤ߘػೳ
    1. JavaScript ͰϦϯΫλοϓ࣌ͷಈ࡞Λॻ͖׵͑!
    1. data-native-screen ଐੑͷ͍ͭͨϦϯΫΛ୳͢!
    2. JavaScript ͰϫϯλΠϜτʔΫϯΛऔಘ

    (ߋ৽ͷ৔߹͸ݱࡏͷ౤ߘ಺༰΋)!
    3. औಘͨ͠৘ใΛωΠςΟϒଆʹड͚౉͢!
    2. ͋ͱ͸ωΠςΟϒͰΑΖ͘͠΍Δ

    View full-size slide

  10. RESTful ͳઃܭ΁ͷಌΕ
    Method! Path Action
    GET /posts index
    POST /posts create
    GET /posts/:id show
    PATCH / PUT /posts/:id update
    DELETE /posts/:id destroy

    View full-size slide

  11. RESTful ͳઃܭ΁ͷಌΕ
    Method! Path Action
    GET /posts index
    GET /posts/new new
    POST /posts create
    GET /posts/:id show
    GET /posts/:id/edit edit
    PATCH / PUT /posts/:id update
    DELETE /posts/:id destroy

    View full-size slide

  12. JavaScript Injection!!
    webViewDidFinishLoad: ͔Β
    native_injection.js ൈਮ

    View full-size slide

  13. ωΠςΟϒ΁ͷ৘ใͷड͚౉͠
    native_injection.js ൈਮ
    URL Scheme ࢖ͬͯ!
    json Λ౉͢

    View full-size slide

  14. ड͚औΖ͏
    app_delegate.rb ൈਮ

    View full-size slide

  15. “ݴ͍͍ͨ͜ͱ΋ݴ͑ͳ͍!
    ͜Μͳιʔγϟϧ͡Ό”
    – ϙΤϜ

    View full-size slide

  16. ࣗݾ঺հ
    ✤ ւ࿝୔ ૱ (@satococoa)!
    ✤ http://satococoa.github.io/!
    ✤ Yokohama.rb, RubyMotion JP, P4D!
    ✤ RubyMotion, Ruby on Rails, Objective-C!
    ✤ גࣜձࣾΠάχε (࠾༻ͯ͠ΔΑʂhttp://1923.co.jp/)
    ߋ৽ࢭ·ͬͯ·͕͢…

    View full-size slide