/iOS_RxSwift_In_4Hours

๐ŸŽ [iOS] ๊ณฐํŠ€๊น€ - RxSwift ๊ธฐ์ดˆ ๊ฐ•์˜

Primary LanguageSwift

RxSwift+MVVM 4์‹œ๊ฐ„์— ๋๋‚ด๊ธฐ

RxSwift 4์‹œ๊ฐ„์— ๋๋‚ด๊ธฐ (์‹œ์ฆŒ2)


Preface

์š”์ฆ˜ ๊ด€์‹ฌ์ด ๋†’์€ RxSwift!

RxSwift๋Š” Swift์— ReactiveX๋ฅผ ์ ์šฉ์‹œ์ผœ ๋น„๋™๊ธฐ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์„ ์ง๊ด€์ ์œผ๋กœ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ๋„๋ก ๋„์™€์ฃผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค.

์ฆ‰, RxSwift๋Š” ๋„๊ตฌ์ž…๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ๋†’์€ ๋Ÿฌ๋‹์ปค๋ธŒ์— ์‰ฝ๊ฒŒ ์ ‘๊ทผํ•˜์ง€ ๋ชปํ•˜๋Š” ๋ถ„์ด ๋งŽ์Šต๋‹ˆ๋‹ค.
๋„๊ตฌ๋ฅผ ์ด์šฉํ•˜๋ ค๊ณ  ๋ฐฐ์šฐ๊ณ  ๋…ธ๋ ฅํ•˜๋Š” ์‹œ๊ฐ„์ด ๋„ˆ๋ฌด ํฐ ๊ฒƒ์€ ๋ฐฐ๋ณด๋‹ค ๋ฐฐ๊ผฝ์ด ๋” ํฐ ๊ฒฉ์ž…๋‹ˆ๋‹ค.
RxSwift์˜ ๊ทผ๋ณธ์ ์ธ ํ•™์Šต ์ž์ฒด๋ณด๋‹ค๋Š”, ๋น ๋ฅด๊ฒŒ ์‚ฌ์šฉ๋ฒ•์„ ์ตํ˜€ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•˜๋Š” ๊ฒƒ์ด ํ˜„์‹ค์ฃผ์˜ ํ”„๋กœ๊ทธ๋ž˜๋จธ๋“ค์—๊ฒŒ๋Š” ๋” ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.



Contents

[1๊ต์‹œ] ๊ฐœ๋…์žก๊ธฐ - RxSwift๋ฅผ ์‚ฌ์šฉํ•œ ๋น„๋™๊ธฐ ํ”„๋กœ๊ทธ๋ž˜๋ฐ

  1. Observable

    • Observable create
    • subscribe ๋กœ ๋ฐ์ดํ„ฐ ์‚ฌ์šฉ
    • Disposable ๋กœ ์ž‘์—… ์ทจ์†Œ
  2. Sugar API



[2๊ต์‹œ] RxSwift ํ™œ์šฉํ•˜๊ธฐ - ์“ฐ๋ ˆ๋“œ์˜ ํ™œ์šฉ๊ณผ ๋ฉ”๋ชจ๋ฆฌ ๊ด€๋ฆฌ

  1. Observable Life-Cycle

    • Subscribed
    • Next
    • Completed / Error
    • Disposabled
  2. ์ˆœํ™˜์ฐธ์กฐ์™€ ๋ฉ”๋ชจ๋ฆฌ ๊ด€๋ฆฌ

  3. ์“ฐ๋ ˆ๋“œ ๋ถ„๊ธฐ

    • DispatchQueue, OperationQueue
    • observeOn, subscribeOn
  4. Stream์˜ ๋ถ„๋ฆฌ ๋ฐ ๋ณ‘ํ•ฉ

    • share
    • combine, merge, zip


[3๊ต์‹œ] RxSwift ํ™œ์šฉ๋ฒ”์œ„ ๋„“ํžˆ๊ธฐ - UI ์ปดํฌ๋„ŒํŠธ์™€์˜ ์—ฐ๋™

  1. Subject

    • Data Control
    • Hot Observable / Cold Observable
  2. RxCocoa

    • UI ์ž‘์—…์˜ ํŠน์ง•
    • Observable / Driver
    • Subject / Relay


[4๊ต์‹œ] RxSwift ๋ฅผ ํ™œ์šฉํ•œ ์•„ํ‚คํ…์ณ - ํ”„๋กœ์ ํŠธ์— MVVM ์ ์šฉํ•˜๊ธฐ

  1. MVVM ์•„ํ‚คํ…์ณ

    • ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์•„ํ‚คํ…์ณ
      architectures
      ํฌ๊ฒŒ๋ณด๊ธฐ(MVC, MVP, MVVM)
    • ์™œ MVVM์„ ์“ฐ๋Š”๊ฐ€?
    • MVVM๊ณผ RxSwift์˜ ๊ฟ€์กฐํ•ฉ
  2. Refactoring to MVVM

  3. MVVM-C



References


License


์ด ์ €์ž‘๋ฌผ์€ ํฌ๋ฆฌ์—์ดํ‹ฐ๋ธŒ ์ปค๋จผ์ฆˆ ์ €์ž‘์žํ‘œ์‹œ 2.0 ๋Œ€ํ•œ๋ฏผ๊ตญ ๋ผ์ด์„ ์Šค์— ๋”ฐ๋ผ ์ด์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.