-
Notifications
You must be signed in to change notification settings - Fork 593
Update flow
Diego Sánchez edited this page Jul 4, 2016
·
1 revision
The following sequence diagram describes the update flow
- The data source notifies about changes
- The view controller takes a snapshot of the
[ChatItemProtocol]
from the data source - It enqueues the update process.
- If the queue is idle continue to 5.
- Dequeue update task
- Jump to a background queue
- Decoration of
[ChatItemProtocol]
(see Decorator) - Calculation of insertions/deletions
- Creation (or reuse*) of Presenters
- Creation of
ChatCollectionViewLayoutModel
forChatCollectionViewLayout
(will come back to the main thread for those items that can't provide its size in the background) - Come back to the main thread and update the
UICollectionView
(reloadData
orperformBatchUpdates
)
(*) 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