Commit Graph

10 Commits

Author SHA1 Message Date
Diego Sánchez 4ae006a81a Fixes for fast-queueing (#157)
Fixes for fast-queueing
2016-06-22 12:37:40 +01:00
Diego Sánchez ee45cdee43 Adds some configuration to tweak how updates are performed: (#145)
- Coalesce updates: when receiving updates from the datasource while an update is being performed, only the last one will be actually executed.
 - Fast updates: allows next performBatchUpdate before completion of the previous one
 - Tracks visible views: keeps track of cells on-screen instead of relying of indexPathsForVisibleItems and indexPathForCell, which are unreliable on fast updates.
2016-06-01 16:33:29 +01:00
Diego Sánchez 592c8ee142 Allows the decorator to override item ids (#143) 2016-06-01 12:30:53 +01:00
Diego Sanchez d66df8e80b Allows subclasses to choose what index paths are used to keep the scrolling position after an update 2016-03-22 18:24:07 +00:00
Diego Sanchez b6bf5289a2 Tentative fix for crash in UICollectionView.performBatchUpdates 2016-03-22 14:41:44 +00:00
Diego Sanchez cf5901cf80 Avoids retaining the view controller until update completes 2016-02-26 11:06:07 +00:00
Diego Sanchez 340a2677f1 Removes completion block from pagination calls.
Now DataSource is responsible for notifying the exact type of change. This implicitly allows more flexibility in the dataSource ( like ignoring such a request! ) and reduces entry points from where changes are enqueued
2016-02-24 18:23:16 +00:00
Diego Sanchez bdb01e4a40 Allows data source to trigger updates with concrete context. Basically this allows to trigger some updates with a non-animated reloadData while others will be animated (performBatchUpdates) 2016-02-09 16:13:43 +00:00
Diego Sanchez 4086d458e3 Allows a datasource to return different chatItem instances when it updates.
Previously, due to the mapping between chatItem instance and presenter, a new presenter would be created. This fixes:
1) That new presenter will have invalid itemVisibility property (would cause a crash when long pressing a text cell)
2) If a new chatItem instance is returned by the dataSource for a previous existing message, but the previous chatItem is leaked, then the presenter would leak too (and it might try to update its cell, as in downloading an image)

This introduces ChatItemCompanion, a structure which attaches a ChatItem with its presenter and decoration attributes. This solves 1) and 2). Still new instances of presenters will be created for new instances of chatItems --> Presenters should avoid keeping any state in its internal storage.
2016-02-08 17:55:23 +00:00
Diego Sanchez a8933a3791 Renames ChatViewController -> BaseChatViewController 2016-02-01 14:57:06 +00:00