Commit Graph
52 Commits
Author SHA1 Message Date
Scott Goodson a58844379c Implementation of Synchronous Concurrency features for AsyncDisplayKit 2.0
This provides internal features on _ASAsyncTransaction and ASDisplayNode to facilitate
implementing public API that allows clients to choose if they would prefer to block
on the completion of unfinished rendering, rather than allow a placeholder state to
become visible.

The internal features are:
-[_ASAsyncTransaction waitUntilComplete]
-[ASDisplayNode recursivelyEnsureDisplay]

Also provided are two such implementations:
-[ASCellNode setNeverShowPlaceholders:], which integrates with both Tables and Collections
-[ASViewController setNeverShowPlaceholders:], which should work with Nav and Tab controllers.

Lastly, on ASDisplayNode, a new property .shouldBypassEnsureDisplay allows individual node types
to exempt themselves from blocking the main thread on their display.

By implementing the feature at the ASCellNode level rather than ASTableView & ASCollectionView,
developers can retain fine-grained control on display characteristics.  For example, certain
cell types may be appropriate to display to the user with placeholders, whereas others may not.

Follow-up work will include unit tests, revisiting names, and the header locations of definitions.
2015-09-27 19:14:36 -07:00
Scott Goodson ee4b771d5d Fix simple issue with ASTableViewStressTest, make Table / Collection handle changes to dataSource / delegate. 2015-09-24 19:59:12 -07:00
Adlai Holler 86c1fa3981 Rename flag, default it to true, shorten some comment lines 2015-09-19 14:21:33 -07:00
Adlai Holler 7cd79e6e6f Tweak comment 2015-09-19 13:43:18 -07:00
Adlai Holler f0f26d3dab Tweak the new pendingReload flag 2015-09-19 13:40:41 -07:00
Adlai Holler 77490e11c0 ASCollectionView: Suspend updates while reload data is pending 2015-09-19 13:35:57 -07:00
Huy Nguyen a8cecbd0ad Avoid doing relayout during initial configuration of table and collection views. 2015-09-08 22:43:28 +03:00
Scott Goodson 08e31e1c37 Created ASCollectionNode with new example project.
Eases support for nesting horizontally scrolling elements within a vertical scroller.

Further changes will improve the API, and optimize handling of the nested working ranges.
2015-09-07 12:54:42 -07:00
Garrett Moon 6624b84c4c Static layout doesn't properly set a height for collection view cells
because their size.width / size.height isn't nan, but FLT_MAX.
2015-08-20 10:40:00 -07: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
Garrett Moon 592e0301dd cache result of responds to selector 2015-08-12 11:46:46 -07:00
Garrett Moon 4f4a26d2a3 ASDK now supports non-flow layouts. We shouldn't be assuming a flow layout. 2015-08-12 11:33:40 -07:00
Huy Nguyen e657bedd40 Automatically relayout cells after orientation changed. 2015-08-09 00:36:58 +03:00
Huy Nguyen 60ed2bca47 Fix _implementsInsetSection of ASCollectionView being check before the asyncDelegate is set. 2015-08-05 17:33:56 +03:00
Levi McCallum 5eb75d6bc7 Add support for sectionInset in ASCollectionView in property and delegate form 2015-08-03 14:36:29 -07:00
Scott Goodson 46bbe479ae Implement warning assertion for supplementary views in ASCollectionView.
Make sure ASTableViewStressTest passes.  It was sometimes testing a scenario UITableView itself doesn't support.
2015-07-25 21:25:40 -07: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
Ethan Nagel c14ecd7e99 short-circuit editing calls after the asyncDataSource has been set to nil (ASCollectionView) 2015-07-16 20:26:45 -07:00
Scott Goodson 06cfe68cbd Clean up ASDataController for readability & API naming consistency. 2015-06-27 11:06:54 -07:00
Rene Cacheaux 0b8f10e488 Removes UICollectionViewFlowLayout requirement. This allows custom collection view layouts. 2015-06-23 13:39:12 -05:00
Rene Cacheaux 777b48cc33 Adds layout controller for collection views. This new layout controller leverages UICollectionViewLayout's layoutAttributesForElementsInRect in order to calculate index paths for items in AsyncDisplayKit ranges. Flow layout is still a requirement in order to test the waters. 2015-06-21 18:37:00 -05:00
Rene Cacheaux e46c13edc5 Exposes ASCollectionView's ability to determine scroll direction. Scroll direction detection can now support 2-axis collection view layouts. ASCollectionView can now determine scrollable axes. 2015-06-21 11:45:25 -05:00
Scott Goodson ba5a6e15c0 Disable asyncDataFetching in ASTableView and ASCollectionView init methods.
It's currently unreliable for some use cases that issue editing calls while
content is displayed or being interacted with.  The performance gain is not
sufficient to sacrifice correctness for the clients that hit this issue,
so it will remain off until fully resolved.
2015-06-14 19:59:39 -07:00
appleguy 7e50f05dfd Merge pull request #445 from levi/master
Prevent UITableView insertion/deletion animations by default
2015-05-21 12:49:48 -10:00
Ethan Nagel d9acd7bb84 More fixes to catch/handle the delegate getting into an invalid state. These changes will allow setting tableView.asyncDataSource/delegate = nil. (Previously this would have no effect in dealloc thanks to ARC magic). Also added some defensive code to help identify the problem earlier. 2015-05-13 11:00:37 -07:00
Ethan Nagel 58402b6af0 change the order we tear things down in setAsyncDelegate/DataSource to avoid a random crash in UIScrollViewAccessibility. 2015-05-12 12:11:05 -07:00
Levi McCallum 1530ef2841 Prevent UITableView insertion/deletion animations by default
Fixes #292
2015-05-07 21:53:38 -07:00
Ethan Nagel 3f509dbd2f add completion block to reloadData methods 2015-03-26 16:32:44 -07:00
Nadine Salter a79b771a85 Remove the nil-asyncDelegate proxy.
Fixes #349.
2015-03-11 17:43:45 -07:00
Ryan Nystrom 6588e7b665 Make data locking API optional 2015-03-04 10:13:32 -08:00
Ryan Nystrom c657411a2e Batch fetch with small data sets 2015-02-26 22:29:13 -08:00
Ryan Nystrom 8d7fe334e2 Revisions based on feedback 2015-02-26 22:29:13 -08:00
Ryan Nystrom b3ae15858a Unit tests for batch fetching 2015-02-26 22:26:25 -08:00
Ryan Nystrom 1f8001a104 ASCollectionView batch API 2015-02-26 22:24:46 -08:00
Ryan Nystrom 4fa03a01d1 Functioning Preload range
Refactor how we do ranges so they can be arbitrarily managed. Introduce the concept of a preload range.
2015-02-26 15:41:32 -08:00
Ryan Nystrom 9c877c51af Support for dynamic ranges
This refactors how we do ranges and implements tuning parameters for a "Render" range and a "Preload" range
2015-02-26 15:40:21 -08:00
Li Tan e862e04b05 Fix wrong assertion 2015-02-25 19:37:22 -08:00
Li Tan 831aa47ae0 Address comments 2015-02-11 19:15:08 -08:00
Li Tan 6a2c472910 Add asyncDataFetchingEnabled as parameter of initializer of ASTableView & ASCollectionView
Conflicts:
	AsyncDisplayKit/ASCollectionView.mm
	AsyncDisplayKit/Details/ASDataController.mm
2015-02-11 17:24:49 -08:00
Li Tan 2f88ce56a2 Move ASTableView & ASCollectionView data fetching to background thread
Conflicts:
	AsyncDisplayKit/ASCollectionView.mm
	AsyncDisplayKit/Details/ASDataController.mm

Conflicts:
	AsyncDisplayKit/ASCollectionView.mm
	AsyncDisplayKit/Details/ASDataController.mm
2015-02-11 17:22:43 -08:00
Li Tan dcb30b359c rename _batchUpdateFlag to _performingBatchUpdates 2015-02-11 15:22:24 -08:00
Li Tan 25bdd0d84d remove program 2015-02-06 11:44:40 -08:00
Dustin Shahidehpour 94cd785870 Added node access methods to ASTableView, ASCollectionView. 2015-01-26 13:57:04 -08:00
Ryan Nystrom afb21bf8dd Default proxy object for ASTableView and ASCollectionView
fixes #231 #233
2015-01-20 13:15:39 -08:00
Nadine Salter 7542f7ca17 Fix build-break. 2015-01-20 12:16:30 -08:00
Li Tan 90cb725b39 Fix Collection View 2015-01-08 16:27:57 -08:00
Ryan Nystrom 0473ed0a44 Consistent curlies on methods 2014-12-29 14:18:35 -08:00
Li Tan 3c0d4b2c42 Remove bachUpdate and begin/endUpdate 2014-12-19 08:48:10 -08:00