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

rxswift2.pdf

Yusuke Hosonuma
June 13, 2016
170

 rxswift2.pdf

Yusuke Hosonuma

June 13, 2016
Tweet

More Decks by Yusuke Hosonuma

Transcript

  1. ΞδΣϯμ • RxSwiftͷϞδϡʔϧ • RxSwiftͷΠϯετʔϧ • Observable<T> —> Observer<T> ͷ઀ଓ

    • RxSwiftͷαϯϓϧίʔυ • ϥΠϒίʔσΟϯάʢؤுͬͯΈΔΑʂʣ
  2. 1) RxSwift • import RxSwift • RxʢReactive ExtensionʣͷίΞ෦෼ͷػೳΛఏ ڙ͢ΔϞδϡʔϧ •

    UIKitͳͲʹґଘ͠ͳ͍७ਮͳϦΞΫςΟϒϓϩ άϥϛϯάͷࡐྉΛఏڙ͢Δ • ଞͷϓϩάϥϛϯάݴޠͰ΋ຆͲಉ͡ʢ͸ͣʣ
  3. ࠓ೔ͷ·ͱΊ • Observable<T> —> Observer<T> ͷ઀ଓ • Rxʹ͓͚ΔσʔλόΠϯσΟϯάػߏ • T͸ܕΛද͠ɺಉ͡ܕͳΒ઀ଓͰ͖Δ

    • ܕ͕ҟͳΔ৔߹͸ετϦʔϜΛՃ޻ʢmapͨ͠ Γʣ͢Δ͜ͱͰɺಉ͡ܕͷετϦʔϜʹ͢Δ͜ ͱ΋ग़དྷΔ
  4. ࠓ೔ͷ·ͱΊ • RxSwiftͷαϯϓϧίʔυ • Ϙλϯλοϓ • εϥΠμʔ • NSNotification •

    ͲΕ΋ڞ௨ͨ͠ύλʔϯɺObservable<T>ͱ Observer<T>ͷ઀ଓɺؒʹՃ޻͕͋ͬͨɻ