225 Commits

Author SHA1 Message Date
Adlai Holler
4baffea8f6 [ASTableView] Ignore table view cell layouts when there's no node assigned (#2091) 2016-08-17 19:58:40 -07:00
Michael Schneider
11215bf97f [Automatic Hierarchy Management] Rename IHM to automatic hierarchy management and move out of beta header (#2066)
* Rename automaticHierarchy to automaticallyManagesSubnodes

* Comment adjustments
2016-08-15 12:06:06 -07:00
Hannah Troisi
2afd063b10 [ASRangeController] Debug overlay to show the size and direction of display + fetchData ranges during scrolling. (#2008)
* Rebase ASRangeController diff with master.

* fix Table / CollectionNode debug label names
- now returns class names rather than generic ASTableNode, ASPagerNode
- ASPagerNode will be labeled as ASPagerNodeProxy (not sure how to get around this)

* refactor layout code: use ASDk's own resizeableRoundedCorner... methods

* Fixes and cleanup for manual layout version of range controller debug overlay.

I am working on a layout spec-based version, but it has some issues, so landing this to get the near-term value is probably the best next step.

* Remove .orig and .rej files.

* One last .orig file to remove.

* Final project file cleanup and tweaks to implementation for ASTableNode.

* fix build issues

* fix arrow directions
2016-08-11 11:23:07 -07:00
Adlai Holler
1fbf8ad073 [ASDataController] Cancel if we lose our data source, fix bugs (#1987)
[ASRangeController] We're already on main thread, remove blocks

Make data source read-only, clarify what's asynchronous

[ASDataController] Clean up some interfaces

[ASDataController] A little more cleanup

[ASDataController] Cleanup

[ASDataController] Restore some changes, exit more often

[ASDataController] Use item counts that we already have rather than requerying them

[ASDataController] Revert weakifications

[ASDataController] Add a mechanism to measure how much work we avoided
2016-08-05 15:39:33 -07:00
Adlai Holler
4725035f21 [ASTableView/ASCollectionView] Flush pending updates before selecting/scrolling to item (#2034) 2016-08-04 13:19:14 -07:00
Hannah Troisi
f5b3a282af Fix Pinterest Xcode 7.3.1 Analyzer Warnings (#1988) 2016-07-27 08:23:16 -07:00
Adlai Holler
7ec6f07953 [General] Remove dead code, check optional protocol selector before calling (#1970) 2016-07-22 13:09:28 -07:00
Adlai Holler
50e8ad2e7c [ASTableView/ASCollectionView] Ignore bounds.origin when checking for zero-size 2016-07-18 12:17:42 -07:00
Hannah Troisi
4baf9bdbfe [Infer] Fix Infer errors/warnings (#1938)
* [Infer] Fix 11 Infer errors/warnings

* fix build error
2016-07-16 15:29:24 -07:00
Adlai Holler
edb4e45c24 [ASRangeController] Update synchronously when possible 2016-07-12 14:36:20 -07:00
Adlai Holler
6b44b5ac05 [ASTableView] Add retainedLayer a la collection view (#1896) 2016-07-11 20:22:45 -07:00
appleguy
3b2af7eb6d [Build] Remove Unused Imports across all of AsyncDisplayKit. This uses a feature of AppCode. (#1875)
Details on the tool are here: https://www.jetbrains.com/help/idea/2016.1/optimizing-imports.html
2016-07-09 17:20:59 -07:00
Scott Goodson
f0ff9c108d Merge branch 'master' of git://github.com/kielgillard/AsyncDisplayKit into kielgillard-master 2016-07-09 15:44:31 -07:00
Adlai Holler
38fab7cd94 Merge pull request #1816 from hannahmbanana/selectionBug
[ASCellNode] Fix selection / highlight implementation
2016-07-08 15:48:22 -07:00
Michael Schneider
02a41f4db5 Move setting the tuning parameters to the range controller in ASTableView 2016-07-08 11:36:43 -07:00
Kiel Gillard
6a15ab6130 * Tidy the header imports, forward declaring classes and protocols where appropriate to avoid import cycles and using the framework/system header notation for imports occuring in .h files.
* Perhaps controversially, decomposing ASRangeControllerUpdateRangeProtocol+Beta.h such that the categories on various classes are defined in the classes themselves since that's where the implementation of those categories is provided.
* Updating unit tests and import other headers the tests took for granted. The tests could probably import the umbrella header and not have to worry about this.
* Updating the "Life without Cocoapods" sample to build and run dependent on ASDK as a static library.
* Added a "Life With Frameworks" sample app to build and run dependent on ASDK as a framework, proving the framework targets work.
2016-07-07 15:12:19 +10:00
Hannah Trosi
f6d30b668d add comments to deprecated getter methods, remove extraneous if statements 2016-07-05 21:30:09 -07:00
Hannah Trosi
3994f2089c [ASCellNode] Final revisions to behavior of setSelected: & setHighlighted: 2016-07-05 17:47:00 -07:00
Hannah Trosi
61d7c093a1 Merge branch 'master' into selectionBug 2016-07-02 11:50:19 -07:00
Hannah Trosi
3080ee33cf Revert "update from master/"
This reverts commit d7fde61e168b6594ca5d74836597b0aac0e83e9b.
2016-07-02 11:45:40 -07:00
Hannah Trosi
d7fde61e16 update from master/ 2016-07-01 16:25:48 -07:00
Adlai Holler
d82e1ce95b Merge pull request #1812 from facebook/AHUpdateIntegrity
[ASDataController] Improve Update Handling, Esp. Reloading Sections
2016-06-27 18:11:11 -07:00
Hannah Troisi
db04f4b851 [ASTableView] Add constrainedSizeForRowAtIndexPath: to control row heights from delegate (#1769)
* [ASTableView] constrainedSizeForRowAtIndexPath

* Quick fix to header file

* Switch to Delegate from DataSource.

* Update testing variables to reflect switch to delegate
2016-06-26 23:09:53 -07:00
Hannah Trosi
2e4b1ea053 [ASCellNode] Fix selection / highlight implementation 2016-06-25 00:22:28 -07:00
Adlai Holler
35056f708b [ASDataController] Improve update handling 2016-06-24 11:12:37 -07:00
Adlai Holler
71d9f64535 Carry over first-pass change set improvements 2016-06-24 11:12:37 -07:00
Adlai Holler
457e08005f [ASDataController] Remove asyncDataFetching Option, Cleanup (#1794)
* [ASDataController] Add some assertions to clarify what queues things happen on

* [ASCollectionDataController] Optimize willReloadData

* [ASDataController] Minor optimizations, no functional changes

* [ASDataController] Always reload data on _editingTransactionQueue

* [ASDataController] Remove async data fetching option, deprecate callbacks

* [ASDataController] Not mutable

* [ASMultidimensionalArrayUtils] Use fast enumeration

* Optimize ASMultidimensionalArrayUtils
2016-06-23 21:08:44 -07:00
Nick Velloff
a05d3119ad [WIP] Trigger new batch fetch for collection view after layout transitions (#1697)
[Table / Collection] Trigger new batch fetch after programmatic scrolls, or layout transitions.
2016-06-22 16:21:10 -07:00
Hannah Troisi
c857e809f4 Clean up header comments (for consistent Facebook licensing info) (#1741)
[Licensing] Clean up header comments (for consistent Facebook licensing info)
2016-06-11 23:31:39 -07:00
appleguy
87575b78ee [ASCellNode] Adding support for scroll view begin / end drag to VisibilityEvent changes. 2016-06-04 22:14:08 -07:00
Nick Velloff
d0c30a43ca expose relayoutAllNodes at ASCollectionView level (#1683)
* expose relayoutAllNodes at ASCollectionView level

* rename relayoutAllNodes to relayoutItems to be more UIKit centric
2016-05-24 13:22:01 +07:00
Rocir Santiago
e8a49b57bc Change ASTableView's visibleNodes interface to return array of ASCellNodes (#1666) 2016-05-22 14:10:12 +08:00
rcancro
8bb4eba080 Initial attempt at implementing Display Traits
Initial attempt to get display traits working with ASEnvironment.

To get proper ASDisplayTraits support, you must use an ASViewController. The ASViewController implements UITraitCollection-related methods (`traitCollectionDidChange:`, `willTransitionToTraitCollection:withTransitionCoordinator:`, viewWillTransitionToSize:withTransitionCoordinator`) to update the internal ASDisplayTraits and propagate them to subnodes.

ASTableNode and ASCollectionNode don't actually have their cells as subnodes, so a little bit of trickery is involved (on `setEnvironment:` the table/collection node gets its data controllers completedNodes and propagates the new traits. see `ASDisplayTraitsCollectionTableSetEnvironmentState`). The data controller also passes the current display traits when creating new cells.

ASViewController also supports the ability to return a custom set of display traits. So if you have a modal dialog that should always be told it is in a compact size class, you can set the override block before displaying the VC.

A new example, called Display Traits, has been added. It shows how display traits can be used in a ASViewController with a normal ASDisplayNode as its root, as well as in ASViewControllers hosting table nodes and collection nodes. There is also an example of overriding the default display traits of a VC.

Please provide feedback!
2016-05-10 14:44:22 -07:00
Michael Schneider
bc8489528e Fix crash in delegate / dataSource proxies for ASCollectionView and ASTableView 2016-05-04 21:03:43 -07:00
Michael Schneider
32f35d9d54 Use visibleNodeIndexPathsForRangeController: to base on visibleNodes in ASTableView 2016-04-26 10:37:32 -07:00
Michael Schneider
28cfd60900 Fix Assertion on cell deallocation due visibility not being cleared
Further information:
- We mark every node as visible in the ASRangeController which NSIndexPath is returned from visibleNodeIndexPathsForRangeController:
- In visibleNodeIndexPathsForRangeController: we get the visible index path's via a call to UITableView's "indexPathsForVisibleRows" method.
- Unfortunately in this case we cannot use indexPathsForVisibleRows to get all the visible index paths as apparently in a grouped UITableView it would return index paths for cells that are just a bit over the edge of the visible area.
- But this edge cells will never get a call for -tableView:cellForRowAtIndexPath:, but we will mark them as visible in the range controller
- In tableView:cellForRowAtIndexPath: we call -configureContentView:forCellNode
- Because we never get a -configureContentView:forCellNode call for the edge cells, the _ASDisplayView of the nodes will never be added to the window and get a willMoveToWindow and didMoveToWindow call and it's never get's added to the window for now and so the node is NOT marked as "in the hirarchy"
- If the deallocation of the views are happening without the UITableView ever scrolled, the cells don't get a call to __exitHierarchy as they were never added to the window and stay in the interface state "visible" and an exception will be raised within the dealloc method of the ASDisplayNode
2016-04-26 10:37:06 -07:00
Michael Schneider
8f1beb8bf6 Addressed comments
- Use memset to clear flags
- Fix check for asyncDataSourceNodeForItemAtIndexPath
- Fix selector for asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPath
- Fix multiple collectionViewWillEditCellsAtIndexPaths:batched: calls
2016-04-19 16:13:30 -07:00
Michael Schneider
3a20c6a1f4 Add caching for delegate and datasource calls in ASCollectionView and ASTableView 2016-04-19 16:13:30 -07:00
Michael Schneider
d0023a97f7 Fix fetching will continually trigger in a loop after reaching end of content
Don't schedule a new check for a batch fetch if no data changed previous batch fetch
2016-04-12 17:14:43 -07:00
Michael Schneider
e9fe92444f Small comment fix 2016-04-09 10:55:52 -07:00
Michael Schneider
c19c2da2ee Remove horizontal scrolling behavior detection for ASTableView 2016-04-09 10:55:52 -07:00
Michael Schneider
24ca09ee6c Move most of the batch fetching logic to a central place for ASTableView and ASCollectionView usage 2016-04-09 10:55:52 -07:00
Michael Schneider
40fe1f3ac7 Schedule _checkForBatchFetching call in animation block 2016-04-09 10:55:52 -07:00
Michael Schneider
ab8928c140 Consolidate methods for batch fetching in ASTableView 2016-04-09 10:55:52 -07:00
Michael Schneider
c25a252e1c Fix fetch call won't occur for content smaller than bounds unless user scrolls 2016-04-09 10:55:52 -07:00
Michael Schneider
2a8a58ec84 Expose the rangeController in ASTableView 2016-04-08 11:13:02 -07:00
Scott Goodson
5b9302b681 Revert "Prevent deallocation of asyncDataSource and asyncDelegate in ASCollectionView and ASTableView"
This reverts commit 3668f45286a56a87d200aea0299caee9d2e4a880.
2016-03-22 14:38:50 -07:00
Michael Schneider
3668f45286 Prevent deallocation of asyncDataSource and asyncDelegate in ASCollectionView and ASTableView
Grab a strong reference for asyncDataSource and asyncDelegate in ASCollectionView and ASTableView before executing the range update to be sure they are not going away while executing the range update. This can happen in range updates while going back in the view controller hierarchy
2016-03-22 08:09:59 -07:00
Eric Jensen
17aebcbaba Add a space between the ? and : in ternarys 2016-03-17 10:38:51 -07:00
appleguy
d9ef0922d8 Merge pull request #1354 from ejensen/cleanup
[Refactoring] Objective-C 2.0 / Modern syntax for arrays, dictionaries, numbers; logic simplification
2016-03-17 01:06:33 -07:00