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

SwiftUIの大地を駆け巡るための仕組みを作る

 SwiftUIの大地を駆け巡るための仕組みを作る

"土に根をおろし、風とともに生きよう。種とともに冬を越え、鳥とともに春を歌おう"

Adfa46c35fd59858d262497800c68df4?s=128

Ryoichi Izumita

May 20, 2021
Tweet

Transcript

  1. SwiftUIͷେ஍Λۦ͚८ΔͨΊͷ࢓૊ΈΛ࡞Δ ࣗࣾαʔϏε։ൃͷגࣜձࣾελσΟετ 
 × ڞ૑ύʔτφʔͷגࣜձࣾΏΊΈ ߹ಉษڧձʂ Γͣ / ࿨ઘాྖҰ /

    @rizumita
  2. ϓϩϑΟʔϧ • ௕໺ݝ҆ಶ໺ࢢࡏॅ • 43ࡀ • גࣜձࣾΏΊΈͰiOSςοΫϦʔυ݉ϦʔυΤϯδχΞ • 19ࡀͰObjective-CΛֶͼͦͷޙWebObjectsΛ͔͋ͭ͏ •

    iOSΞϓϦ։ൃ͸iPhone 3GSΛߪೖͨ࣌͠ʹ։࢝
  3. SwiftUIͰ஫໨͞Ε͍ͯΔΞʔΩςΫνϟύλʔϯ • MVVM • The Composable Architecture • Elm Architecture

    • Redux MVVMҎ֎Ͱ͸ؔ਺ܕΞʔΩςΫνϟύλʔϯ͕ಛʹ஫໨͞Ε͓ͯΓɺ ͦΕΒ͸SwiftUIͱ͍͏ܥͱ͸ผݸͷؔ਺ܕͷܥΛ࡞ΓɺೋͭͷܥΛܨ͍͛ͯΔɻ ผݸͷܥͳͷͰSwiftUIͷView֊૚ͷதͰมԽ͢ΔEnvironment΍EnvironmentObjectΛޮՌతʹར ༻͢Δࣄ͕Ͱ͖ͳ͍͜ͱ͕ଟ͍ɻ
  4. ࢲʹ͸ɺͦΕΒ͸ఱۭ͔Β SwiftUIͱ͍͏େ஍Λ ίϯτϩʔϧ͍ͯ͠ΔΑ͏ʹࢥ͑Δɻ

  5. ඬྲྀதͷΨϦϰΝʔͱ ૺ۰͢Δڊେͳʮۭඈ Ϳౡʯϥϐϡʔλ JɾJɾάϥϯϰΟϧ

  6. –ΰϯυΞͷ୩ͷՎ “౔ʹࠜΛ͓Ζ͠ɺ෩ͱͱ΋ʹੜ͖Α͏ɻ छͱͱ΋ʹౙΛӽ͑ɺௗͱͱ΋ʹय़ΛՎ͓͏”

  7. SwiftUIͷେ஍Λۦ͚८ΔͨΊʹ • γεςϜʹجͮ͘࢓૊ΈͰ࣮૷͢Δͷ͕جຊɻ • SwiftUIͷView֊૚ʹ͸؀ڥ͕૊Έࠐ·Ε͍ͯΔɻͭ·ΓView֊૚ͦ͜ ͕ΞϓϦͷϕʔεͱ͍͑Δɻ • ͔͠͠View͕ModelϨΠϠʔʹґଘ͢Δͱ໰୊͕ൃੜ͢Δɻ • View΍ͦͷ؀ڥͱModelΛܨ͙৔ॴ͕ඞཁͱͳΔɻ

  8. Sede SwiftUI༻ͷViewͱModelΛόΠϯυ͢ΔͨΊͷϥΠϒϥϦ ϧʔςΟϯάػೳ΋ https://github.com/rizumita/Sede

  9. ࢖͍ํͱϥΠϒϥϦͷ࣮૷Λݟ͍͖ͯͨͩ·͢ɻ https://github.com/rizumita/Sede

  10. ͓ΘΓʹ • ඪ४ͷ؀ڥʹଇ࣮ͬͨ૷͕جຊͩͱߟ͍͑ͯΔɻ • ؔ਺ܕΞʔΩςΫνϟύλʔϯͳͲͷผͷܥͷ࢓૊Έ΋ྑ͍͕ɺ·ͣ͸ SwiftUIͱ͍͏ϑϨʔϜϫʔΫʹଇͬͨ࢓૊ΈΛݕ౼͍ͨ͠ɻ • ͜ͷϥΠϒϥϦ͸࣮ݧతͳ࣮૷Ͱ͋ΓɺΑΓΑ͍࣮૷Λ୳Δඞཁ͕͋ Δɻ •

    ΞΠσΞ͕͋Ε͹IssueΛॻ͍͍ͯͩ͘͞ɻ
  11. ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ