Commit Graph
72 Commits
Author SHA1 Message Date
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
Levi McCallum aa1842e484 Remove non-null definitions 2015-10-15 11:40:50 -07:00
Levi McCallum 6e49e1f4d5 Initialize mutable editing nodes before section insertion 2015-10-15 11:40:50 -07:00
Levi McCallum f041a273b5 Use rows mutable array for section deletion 2015-10-15 11:40:50 -07:00
Levi McCallum afda471bd0 Clean up interfacing with internal editing/completed stores 2015-10-15 11:40:50 -07:00
Levi McCallum 835f9e99ca Batch render supplementary views on reload data 2015-10-15 11:40:49 -07:00
Levi McCallum a3dce24fdc Document data controller node population 2015-10-15 11:40:49 -07:00
Levi McCallum bdd786f593 Document internal storage behaviors of ASDataController 2015-10-15 11:40:49 -07:00
Levi McCallum da7a2a5d48 Further implement data controller support and layout introspection 2015-10-15 11:40:49 -07:00
Levi McCallum ed1b737ead Define initial supplementary node creation behavior 2015-10-15 11:40:48 -07:00
Levi McCallum e9eadac4ae Stub out ASCollectionDataController subclass 2015-10-15 11:40:48 -07:00
Adlai Holler fbd3c77fec Finish that thought 2015-10-11 08:43:43 -07:00
Adlai Holler d964364cd5 Add some documentation in DataController, plus use Fast Enumeration more 2015-10-11 08:39:29 -07:00
Adlai Holler 595891629c Remove pointless assertion 2015-10-10 10:33:56 -07:00
Adlai Holler 0c361894ac Remove comment 2015-10-09 21:17:11 -07:00
Adlai Holler 1e232561f4 Whitespace 2015-10-09 21:16:28 -07:00
Adlai Holler 7f42b37dec Remove needsMeasure 2015-10-09 21:13:00 -07:00
Adlai Holler fdb11275db Put back the frame-setting behavior when measuring cell nodes 2015-10-09 20:23:54 -07:00
Adlai Holler 06b7897bc1 Finish measuring on main thread when possible 2015-10-09 20:06:59 -07:00
Adlai Holler 93cdc0f2f5 Don't set cell node frames during measurement 2015-10-09 19:55:14 -07:00
Adlai Holler 223e9ff504 Merge branch 'DontSetCellNodeFramesDuringMeasure' into MeasureCellNodesOnMain
Conflicts:
	AsyncDisplayKit/Details/ASDataController.mm
2015-10-09 19:53:46 -07:00
Adlai Holler e716ccb580 Don't set cell node frames during measure, set them just before returning the cell size to UITableView/UICollectionView 2015-10-09 19:51:12 -07:00
Adlai Holler e92a6ce9e3 Initial work on measuring loaded cell nodes on the main thread 2015-10-09 19:37:36 -07:00
Adlai Holler 99b9f73b1a Fix index into size ranges 2015-10-05 11:51:05 -07:00
Adlai Holler 33c07db58c Set node.frame entirely 2015-10-05 11:42:25 -07:00
Adlai Holler 4601fccb5a Optimize ASDataController._layoutNodes 2015-10-05 11:37:29 -07:00
Huy Nguyen a94cd9dd99 Remove externalCompletedNodes getter in ASDataController. 2015-09-28 00:18:49 +03:00
Huy Nguyen e619edcd86 Ensure data consistency between ASDataController and its delegate while executing update transactions. 2015-09-27 22:59:36 +03:00
Steven Ramkumar d09888f9c2 Add a indexPathForNode: to ASTableView 2015-09-22 12:09:56 -07:00
Huy Nguyen 97f323a8d9 Fix relayoutAllRows to trigger measurement (with the new constrained size) on all nodes, including loading ones. 2015-08-21 01:02:19 +03:00
Huy Nguyen 7249661990 Improve relayout when constrained size of all nodes is changed:
- In -layoutSubviews of table and collection views, detect changes that cause a different constrained size for nodes, and trigger relayout immediately.
- Orientation change can be handled by this solution. So, no need to observe to its events.
- Update Kittens example to support iPad (easier to catch bugs on these devices) and add a title to navigation bar (looks a bit nicer).
2015-08-13 06:28:47 +03:00
Huy Nguyen a3c2dbf8cd Table and collection views' async data source can provide different constrained size per node. And because the size is of type ASSizeRange, it has a min size that is very helpful in many cases.. 2015-08-12 22:45:08 +03:00
Huy Nguyen e657bedd40 Automatically relayout cells after orientation changed. 2015-08-09 00:36:58 +03:00
Ethan Nagel bf0766169b PR Feedback: Require main thread for all edit commands, various cleanup. 2015-07-20 22:08:19 -07:00
Ethan Nagel f497639124 Add support automatically adjusting the content offset to UITableView as well as support for performing endUpdates with no animations. Additionally, there are critical bug fixes for ASDataController (begin/end updates delegates not called in correct order) and ASRangeController (failure to fully refresh internal state when inserts or delete are made.) 2015-07-20 14:05:56 -07:00
Scott Goodson 8fa092fb77 Complete overhaul of ASFlowLayoutController.
Introduced ASIndexPath for efficient handling of index paths in C++ vectors,
while maintaining the readability of ".section" and ".row" instead of
".first" and ".second" inside of complicated business logic.

Confirmed that the working range calls are firing appropriately during
ASTableViewStressTest, including the deallocation of the rich text placeholders
provided by ASTextNode.
2015-07-04 20:22:04 -07:00
Scott Goodson 57465c7fd3 Overhaul ASDataController and extensively test ASTableView.
This diff resolves all known consistency issues with ASTableView and ASCollectionView.
It includes significantly more aggressive thrash-testing in ASTableViewStressTest,
which now passes on a variety of device and simulator configurations.  It also updates
the unit tests run on every commit to ensure any regression is caught quickly.

A few of the salient changes in this diff:
- ASTableView now uses Rene's ASCollectionViewLayoutController, and actually uses a
UICollectionViewFlowLayout without any UICollectionView.  This resolves an issue where
ASFlowLayoutController was generating slightly out-of-bounds indicies when programmatically
scrolling past the end of the table content.  Because the custom implementation is likely
faster, I will revisit this later with profiling and possibly returning to the custom impl.
- There is now a second copy of the _nodes array maintained by ASDataController.  It shares
the same node instances, but this does add some overhead to manipulating the arrays. I've
filed a task to follow up with optimization, as there are several great opportunities to
make it faster.  However, I don't believe the overhead is a significant issue, and it does
guarantee correctness in even the toughest app usage scenarios.
- ASDataController no longer supports calling its delegate /before/ edit operations.  No
other class was relying on this behavior, and it would be unusual for an app developer to
use ASDataController directly.  However, it is possible that someone with a custom view
that integrates with ASDataController and ASRangeController could be affected by this.
- Further cleanup of organization, naming, additional comments, reduced code length
wherever possible.  Overall, significantly more accessible to a new reader.
2015-06-28 18:03:45 -07:00
Scott Goodson feba7f8ed1 Update the identifier that AsyncDisplayKit uses to label its internal queues (2/2). 2015-06-27 12:10:58 -07:00
Scott Goodson dc19970fe8 Clean up organization and naming of methods internal to ASDataController. 2015-06-27 11:48:55 -07:00
Scott Goodson 06cfe68cbd Clean up ASDataController for readability & API naming consistency. 2015-06-27 11:06:54 -07:00
Scott Goodson c700618862 Improvements to thread safety during closely spaced edit events.
This applies primarily when beginUpdates / endUpdates is not used.
Due to user interaction-driven edits, like reloads or adding content
at the bottom, sometimes this is unavoidable in app design and thus
critical.

I have a diff in flight to make ASDataController / ASRangeController
robust against very aggressive thrash testing, which will be added
both to the unit test suite and this new example project.
2015-06-21 21:04:09 -07:00
appleguy 079da308ef Merge pull request #437 from eanagel/ASDataController-release-nodes
ASDataController dealloc, ensure cell nodes are not in a superview
2015-05-16 22:49:55 -10:00