113 Commits

Author SHA1 Message Date
Huy Nguyen
54cde1a3db Introduce ASIndexedNodeContext
- It is a container object that holds enough information to construct and measure a cell node
- All information is gathered on main thread. This allows ASDataController to capture the correct state of its data source before going to background.
2016-02-29 01:00:16 -08:00
appleguy
b75d6627bb Revert "Revert "Revert "[ASCollectionView / ASTableView] Optimize reloadData and reloadSection: methods.""" 2016-02-19 23:26:29 -08:00
appleguy
2b10d84a2b Revert "fix scheduling issue that causes collectionView to not animate" 2016-02-19 23:26:12 -08:00
Scott Goodson
a1061301e0 [ASDataController] Revert the reloadData optimizations again - need to fix apps relying on prior behavior.
The optimization seems correct now, but apps like Pinterest have some core code relying on edit operation
order that is actually not permitted by UIKit (and this diff) but were tolerated previously.  We will
re-land this once we have time to adapt the code.
2016-02-19 21:31:39 -08:00
appleguy
32aa333c21 Revert "[ASCollectionView / ASTableView] Optimize reloadData and reloadSection: methods." 2016-02-18 19:50:06 -08:00
appleguy
33d4c8693d Merge pull request #1171 from lkzhao/ASDataController-reload
[ASCollectionView / ASTableView] Optimize reloadData and reloadSection: methods.
2016-02-18 17:36:14 -08:00
Luke Zhao
40791dd859 optimize reload data, reload sections, & move nodes performance & logic 2016-02-18 14:44:16 -08:00
Rahul Malik
19cc368d15 In addition to allocating nodes in the background, perform that operation concurrently in ASDataController 2016-02-17 22:30:58 -08:00
Bin Liu
db1a91234d Improve reload handling in BatchUpdates 2016-02-16 11:04:21 -08:00
Scott Goodson
fce722b0c8 [ASDisplayNode] Allow display-scheduling method to be called concurrently. 2016-02-13 00:58:56 -08:00
Bin Liu
88ff693327 Fixes in ChangeSet and DataController 2016-02-11 23:51:32 -08:00
Bin Liu
9e53dcd402 Fix allocatedNodes Subarray to match indexPaths subarray 2016-02-10 01:35:07 -08:00
Rahul Malik
c4f489b074 Address comments. 2016-02-04 16:56:29 -08:00
Rahul Malik
521c3fa1c1 Move ASCellNode allocation off the main thread by the addition of a node block
API in ASDataController. Move allocations and loaded node layouts to occur
during batch layout phase.
2016-02-04 10:38:59 -08:00
Huy Nguyen
56c6bd681b Revert "Revert commit 83aaa46, thus bring 2e4d716 back"
This reverts commit 209425c22ce84ecbb7ab631753ec8fc34dd9cbb0.
2016-01-26 12:05:02 -08:00
Huy Nguyen
209425c22c Revert commit 83aaa46, thus bring 2e4d716 back 2016-01-24 23:38:05 -08:00
Scott Goodson
83aaa4637e Revert "ASDataController now handles reloadData more efficiently and notify its delegate once instead of a series of deletes and inserts"
This reverts commit 2e4d716e0b65465d9c65b5821668c38e5fa956c9.

Possible issue with this commit.
2016-01-22 20:33:33 -08:00
Huy Nguyen
2e4d716e0b ASDataController now handles reloadData more efficiently and notify its delegate once instead of a series of deletes and inserts 2016-01-21 11:21:21 -08:00
Scott Goodson
df10f8f19a Check array size before accessing section - rare crash for improper data source use, de-escalated to messaging nil. 2016-01-14 00:25:53 -08:00
Scott Goodson
7dff6ffa14 Re-enable program flow instrumentation for Coveralls. More null-specifiers.
This does cause tests to crash at the end, which unfortunately seems like a known Xcode 7 bug.
2015-12-25 22:13:35 -08:00
Garrett Moon
941a732fd6 Rename and move ASMainSerialQueue to its own class 2015-12-11 10:53:06 -08:00
Garrett Moon
066596314e Fix deadlock when an editing transaction needs to perform its work on the main thread, and then elsewhere, on the main thread, we block waiting for all editing transactions to finish 2015-12-11 10:45:23 -08:00
Garrett Moon
f94229796c Fixes out of order blocks running on main queue in ASDataController
ASDataController’s completedNodes is accessed by treating the main thread as a serial queue. The ​*problem*​ is, operations can cut in line by being added while on the main thread. I.e. it just calls the block instead of dispatch_async’ing to the main thread. This results in data inconsistency.

To address this, I've added a queue of operations which get run serially (not to be confused with a serial dispatch queue). Instead of running blocks directly on the main thread, if it’s called while not on the main thread, it dispatch_asyncs to the main thread and runs any blocks in the queue. If it ​*is*​ on the main thread, it runs any blocks already in the queue and then runs the block.
2015-12-11 10:45:22 -08:00
Scott Goodson
88b36f58e7 Ensure an empty array is returned if visibleNodes is called before any nodes are complete. 2015-12-06 21:45:46 -08:00
Huy Nguyen
cd31f884dd Move ASDisplayNodePerformBlockOnMainThread to ASInternalHelpers 2015-10-29 16:09:36 +02:00
appleguy
8dddcaa74b Merge pull request #766 from levi/levi/synchronous-reloaddata
Add synchronous reloadData methods to ASTableView and ASCollectionView
2015-10-25 21:05:52 -07:00
Levi McCallum
722b90f1cf Implement basic immediate reloadData method on table and collection view 2015-10-22 21:28:44 -07:00
Levi McCallum
c33d6efa8a WIP synchronous reload data on collection view 2015-10-22 21:28:30 -07:00
Levi McCallum
45ff74b604 Remove array fallback on editing node index paths 2015-10-21 23:17:38 -07:00
Levi McCallum
9697edac33 Fix conditional block style 2015-10-21 23:17:37 -07:00
Levi McCallum
11076b115e Used cached layout value in node remeasurement 2015-10-21 23:17:37 -07:00
Levi McCallum
55c1b8f6e7 Fix variable naming in debug log 2015-10-15 11:40:53 -07:00
Levi McCallum
ee0cc2001a Add support for loaded node layout for supplementary views 2015-10-15 11:40:52 -07:00
Levi McCallum
952a66a924 Remove initial data loading subclass hook 2015-10-15 11:40:52 -07:00
Levi McCallum
1c717c74b8 Homogenize cell node measuring 2015-10-15 11:40:52 -07:00
Levi McCallum
fddb0061b0 Use ASCellNodes for supplementary nodes 2015-10-15 11:40:52 -07:00
Levi McCallum
848dc26a0d Fix hook method naming 2015-10-15 11:40:52 -07:00
Levi McCallum
4fb4119f9c Clarify data controller subclass hooks 2015-10-15 11:40:52 -07:00
Levi McCallum
eb5c79598c Clean up arrangement of data controller subclassing methods 2015-10-15 11:40:52 -07:00
Levi McCallum
3f0092435a Add support to move supplementary nodes with section position changes 2015-10-15 11:40:51 -07:00
Levi McCallum
9235ce5ac2 Support reloading supplementary nodes when sections reload 2015-10-15 11:40:51 -07:00
Levi McCallum
f9bba315df Stub out subclass hooks for section insert/remove/update/moving 2015-10-15 11:40:51 -07:00
Levi McCallum
ed7a73361b Use simpler completed nodes loop 2015-10-15 11:40:51 -07:00
Levi McCallum
71966f3549 Relayout all nodes in backing store on relayoutAllNodes 2015-10-15 11:40:51 -07:00
Levi McCallum
b58649fdcb Clean up supplementary nodes in data controller store on each reload 2015-10-15 11:40:51 -07:00
Levi McCallum
769a67569c Batch layout as display nodes 2015-10-15 11:40:50 -07:00
Levi McCallum
34f3065825 Use local method for introspecting data controller constrained sizes 2015-10-15 11:40:50 -07:00
Levi McCallum
0086949a65 Fix typo 2015-10-15 11:40:50 -07:00
Levi McCallum
1c2046cdf4 Localize debugging LOG definition 2015-10-15 11:40:50 -07:00
Levi McCallum
e4f274aebb Expose completed nodes array by kind 2015-10-15 11:40:50 -07:00