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

iOSアプリエンジニアがReact Nativeを使ってみて

iOSアプリエンジニアがReact Nativeを使ってみて

iOSアプリエンジニアがReact Nativeを使ってみての雑感についてです、

Shuichi Nagao

March 23, 2018
Tweet

More Decks by Shuichi Nagao

Other Decks in Programming

Transcript

  1. REACT NATIVEͱ͸ʁ ▸ React͸Facebook͕։ൃͨ͠JavaScriptͷϑϨʔϜϫʔΫ ▸ React Native(ҎԼRN)͸ͦΕΛiOS/AndroidʹԠ༻ͨ͠΋ͷ ▸ 2015೥3݄ʹiOSɺಉ೥9݄ʹAndroid͕ϦϦʔε͞Εͨ ▸

    ಉ͡JSͷίʔυͰiOS / Android͕ಈ͘ ▸ جຊతʹReactʹͦͬ͘Γ ▸ ωΠςΟϒͷUIΛ࢖͍ɺϝΠϯͷUIεϨουͱ͸ผͰಈ͘ͷ ͰύϑΥʔϚϯε΋ѱ͘ͳ͍ 3
  2. ωΠςΟϒ։ൃͱͷҧ͍ React Native ωΠςΟϒ IDE ਓʹΑΔ VS Code / IntelliJ

    / etc. Xcode / Android Studio ݴޠ JavaScriptͷΈ ܕ͕ͳ͍ Swift / Kotlin (Objective-c / Java) ܕ͕͋Δ σόοά ํ๏ ैདྷͷIDE͚ͩͰͳ͘ChromeͰ JavaScript௨Γͷσόοά͕Ͱ͖Δ IDEΛར༻͢Δ͜ͱʹͳΔ Ϗϧυ ϗοτϦϩʔυͰ ίʔυͷ൓ө͕Ͱ͖Δ ຖ౓෼୯ҐͰ଴ͭ͜ͱ͕͋Δ 5
  3. ωΠςΟϒ։ൃͱͷҧ͍ ~ઃܭ~ ▸ RN͸Reactͷࢥ૝Λܧঝ͍ͯ͠ΔͷͰɺωΠςΟϒͷϏϡʔͷϥΠϑαΠ Ϋϧͱ͸ҟͳΔ࣮૷Λ͢Δඞཁ͕͋Δ ▸ Props / State /

    Component ͱ͍͏֓೦͕ωΠςΟϒʹ͸ͳ͍ ▸ viewWillAppearͷΑ͏ͳϝιου͕ͳ͍ ▸ RNͰ͸جຊReduxΛར༻͢Δ͜ͱʹͳΔ͕Α͋͘ΔωΠςΟϒΞϓϦͷ ઃܭํ਑ͱ͸େ͖͘ҟͳΔ ▸ reduxͰ͸ɺStore͕άϩʔόϧʹΞϓϦͷঢ়ଶ؅ཧΛ͠ɺView͸ͦͷ Storeͷঢ়ଶΛ؂ࢹͯ͠มԽ͕͋Ε͹࠶ඳը͞ΕΔ ▸ RN+ReduxͰͲ͏΍ͬͯϏδωεϩδοΫΛॻ͍͍ͯ͘ͷ͔ͱ͍͏஌ ݟ͕ѹ౗తʹগͳ͍ 7
  4. ωΠςΟϒ։ൃͱͷҧ͍ ~࣮૷~ ▸ Navigationͷ࣮૷͕RNͩͱϥΠϒϥϦબఆ͔Β࢝·Δ ▸ ͦ΋ͦ΋ඪ४ͷNavigation͕͠ΐ΅͍ ▸ React Native +

    ReduxͳΒreact-navigation͕ྑ͍͔ ▸ UIͷ࣮૷͸React(Web frontend)ͷͦΕʹۙ͘ɺωΠςΟϒΞϓϦͷͦΕ ͱ͸͔͚཭Ε͍ͯΔ ▸ CSS΍flexboxͱ͍ͬͨ֓೦͕ωΠςΟϒΞϓϦʹ͸ͳ͍ ▸ ωΠςΟϒͰ͸౰ͨΓલͷίϯϙʔωϯτΛ࢖͏ΑΓ΋native-base΍ RN͕ඪ४Ͱαϙʔτ͍ͯ͠Δ΋ͷΛར༻͢Δ͜ͱʹͳΔ ▸ σβΠϯ΋ωΠςΟϒͱ͍͏ΑΓ͸গ͠WebʹدͤΔඞཁ͕͋Δ 8
  5. ωΠςΟϒ։ൃͱͷҧ͍ ~࣮૷~ ▸ OS͕αϙʔτ͍ͯ͠ΔAPI΍ωΠςΟϒ޲͚ͷ֎෦ͷSDKΛར༻͢Δ࣌ʹ ωΠςΟϒͷ࣮૷͕ඞཁʹͳΔ͜ͱ͕͋Δ ▸ ιʔείʔυ͕iOS / AndroidͰجຊಉ͡ͳͷͰɺUI͕ϓϥοτϑΥʔϜ ʹΑͬͯେ͖͘ม͑Α͏ͱ͢Δͱ෼ذ΋େ͖͘ͳͬͯෳࡶʹͳΔ

    ▸ ωΠςΟϒͰ͸ҰॠͰ࣮૷Ͱ͖Δ͜ͱ΋RNͩͱ׳Εͳ͍͏ͪ͸͙͢Ͱ͖ Δͷ͔Θ͔Βͣɺ޻਺ͷݟੵ΋Γ΋໽հͩͬͨ ▸ ʮ͜ͷσβΠϯ͙ͬͯ͢Ͱ͖·͢ʁʯ͕͙͢ʹ౴͑ΒΕͳ͔ͬͨ ▸ iOS / AndroidͰϩδοΫ͕࣮͸ҧ͍ͬͯͨɺͱ͍͏൵͕ܶى͜Βͳ͍ ▸ paymoͰ͸͜͏͍͏൵͕ܶ࠷ۙଟ͘ൃ֮ͨ͠ 9