rwblickhan / Spreppy

A spaced repetition flashcards app
1 stars 0 forks source link

Display deck name in deck study view #17

Closed rwblickhan closed 3 years ago

rwblickhan commented 3 years ago

In #16 I set this to default to the UUID that's passed in to DeckStudyViewController. It would be nice to show the actual name of the deck from the data model instead.

That's actually going to be more difficult than it looks, hence why this isn't necessarily a good task for new folks.

  1. Add a fetchDeck() method to DeckRepository that returns an AnyPublisher<DeckModel, Never> with the updates for just one deck. (I suppose in theory we could use fetchDeckList() and just filter the resulting [DeckModel], but that feels icky.
  2. That will likely require some cleverness in DeckCoreDataRepository to ensure having multiple fetch controllers etc will work as expected.
  3. Subscribe to fetchDeck() in DeckStudyViewModel.handle(.viewDidLoad).
  4. In the subscription, set state.title.