Skip to content

Update flow

Diego Sánchez edited this page Jul 4, 2016 · 1 revision

Update flow

The following sequence diagram describes the update flow

seq-diagram-update-cycle

  1. The data source notifies about changes
  2. The view controller takes a snapshot of the [ChatItemProtocol] from the data source
  3. It enqueues the update process.
  4. If the queue is idle continue to 5.
  5. Dequeue update task
  6. Jump to a background queue
  7. Decoration of [ChatItemProtocol] (see Decorator)
  8. Calculation of insertions/deletions
  9. Creation (or reuse*) of Presenters
  10. Creation of ChatCollectionViewLayoutModel for ChatCollectionViewLayout (will come back to the main thread for those items that can't provide its size in the background)
  11. Come back to the main thread and update the UICollectionView (reloadData or performBatchUpdates)

(*) A presenter is reused iff the same instance of the [ChatItemProtocol] that it was created with exits in the new collection of chat items and its uid was not mutated

Clone this wiki locally