Chapter 15, Challenge 2

As far as the idea behind Challenge 2 is clear, the concrete solution of it could be done in a very simple way, considering that TasksViewModel already has sectionedItems property, - just subscribe to it in the bindViewModel():

viewModel.sectionedItems
  .subscribe(onNext: { [weak self] items in
    DispatchQueue.main.async {
      self?.statisticsLabel.text = "Due: \(items[0].items.count) Due: \(items[1].items.count)"
    }
  })
  .disposed(by: self.rx.disposeBag)

I mean, all hint steps are already implemented in that property.

P.S. Unfortunately, I cannot change title of this post but in fact the issue is in Chapter 25!

@fpillet Can you please help with this when you get a chance? Thank you - much appreciated! :]

This topic was automatically closed after 166 days. New replies are no longer allowed.