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

Introduction Differ/differ

corin8823
October 25, 2017

Introduction Differ/differ

corin8823

October 25, 2017
Tweet

More Decks by corin8823

Other Decks in Technology

Transcript

  1. 'MVYྫ final class TopViewController: UIViewController { @IBOutlet weak var tableView:

    UITableView! private let store = TopStore() private let disposeBag = DisposeBag() override func viewDidLoad() { super.viewDidLoad() self.store.items .asObservable() .bind { [weak self] _ in self?.tableView.reloadData() } .disposed(by: self.disposeBag) } }
  2. 'MVYྫ final class TopViewController: UIViewController { @IBOutlet weak var tableView:

    UITableView! private let store = TopStore() private let disposeBag = DisposeBag() override func viewDidLoad() { super.viewDidLoad() self.store.items .asObservable() .bind { [weak self] _ in self?.tableView.reloadData() } .disposed(by: self.disposeBag) } }
  3. w XPLBMTLJ%J⒎TXJGU͕΋ͱ΋ͱ w 0 / . %  w /ͱ.͕഑ྻͷ௕͞ɺ%͕ࠩ෼

    w ഑ྻͷҧ͍Λੜ੒ w UBCMF7JFXͱ$PMMFDUJPO7JFXͷ&YUFOTJPO΋ UPOZBSOPME%J⒎FS IUUQDPOTUFMMBUJPOIBUFOBCMPHDPNFOUSZ IUUQTHJUIVCDPNXPLBMTLJ%J⒎TXJGU
  4. UPOZBSOPME%J⒎FS IUUQTHJUIVCDPNKqJOUFS%XJ⒎U w KqJOUFS%XJ⒎U΋͋Δ w UPOZBSOPME%J⒎1FSGPSNBODF4VJUF w BOJNBUF3PX$IBOHFT PME%BUBPME OFX%BUBOFX

     w BOJNBUF3PX"OE4FDUJPO$IBOHFT PME%BUBPME  OFX%BUBOFX IUUQTHJUIVCDPNUPOZBSOPME%J⒎1FSGPSNBODF4VJUF
  5. 'MVYXJUI%J⒎FS final class TopViewController: UIViewController { @IBOutlet weak var tableView:

    UITableView! private let store = TopStore() private let disposeBag = DisposeBag() override func viewDidLoad() { super.viewDidLoad() self.store.items .asObservable()
 .scan([]) { [weak self] (old, new) -> [String] in self?.tableView.animateRowChanges( oldData: old, newData: new) return new }.bind { [weak self] _ in } .disposed(by: self.disposeBag) } }