261 Commits

Author SHA1 Message Date
Michael Schneider
30bb2ee93d Address comments from @levi 2016-07-13 16:36:48 -07:00
Michael Schneider
9fb3129a0e Add default ASCollectionViewLayoutInspecting for custom ASCollectionViewLayout 2016-07-13 16:36:48 -07:00
Michael Schneider
35c860c183 Refactor usage of ASCollectionViewLayoutInspecting
- Fix not using itemSize of UICollectionViewFlowLayout
- Move automatic constrained size calculation to the ASCollectionViewFlowLayoutInspector
- Provide a null layout inspector for throwing exceptions if a custom
  UICollectionView is given but no ASCollectionViewLayoutInspecting
- Fix not checking for optional layout inspecting data source methods
  are implemented or not
- Improving tests around ASCollectionViewLayoutInspecting
2016-07-13 16:36:48 -07:00
Adlai Holler
edb4e45c24 [ASRangeController] Update synchronously when possible 2016-07-12 14:36:20 -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
Adlai Holler
b1626b0f69 Merge pull request #1791 from colinmcardell/ASCollectionDataController_supplementaryNodeOfKind-fix
[ASCollectionDataController] Exposing -supplementaryNodeOfKind
2016-07-08 12:50:32 -07:00
Adlai Holler
8e1c8acb54 Merge pull request #1861 from facebook/AHCollectionViewLayerRetaining
[ASCollectionView] Add strong Layer Pointer Under iOS < 9 to Workaround Crashes
2016-07-07 18:26:02 -07:00
Adlai Holler
54ee62f002 [ASCollectionView] Add a strong pointer from ASCollectionView -> layer under iOS < 9 to workaround issue 2016-07-07 10:36:41 -07:00
Michael Schneider
94ca363936 Add return type to the shouldNotAnimateBlock 2016-07-07 07:00:07 -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
Adlai Holler
c62a4d3e79 [ASCollectionView] Greatly Improve Cell Node Resizing (#1853)
* [ASCollectionView] Initial pass at reducing double-sided animations

* [ASCollectionView] Always suppress animation during node size requery

* [ASCollectionView] Rejigger the invalidation logic to support animated size changes

* [ASCollectionView] Remove unused header

* [ASCollectionView] Change comment

* [ASDataController] Remove unused variable

* [ASCollectionView] When relayout animated due to cell size change, wait until next layout pass

* [ASCollectionView] Invalidate layout synchronously

* [ASCollectionView] Only read the layout object once

* [ASCollectionView] When size changes, wait for requery before layout

* [ASCollectionView] Sort of go back to using an empty update to handle node resizing

* [ASCollectionView] Remove unused constant

* [ASCollectionView] Address PR comments

* [ASCollectionView] Prevent nested [super performBatchUpdates:] calls
2016-07-06 14:13:52 -07: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
Michael Schneider
c20f452dca Remove check for [UIDevice systemVersion] check if running on iOS 7 (#1843) 2016-07-03 21:47:35 -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
a77a6eaaf5 Merge pull request #1820 from gazreese/ASCollectionView-tuning-parameters
[ASCollectionView] Tuning parameters not set
2016-07-01 15:09:01 -07:00
Colin McArdell and Robin Chou
9c13018568 Updates exposed method signature and docs for what is now -supplementaryNodeForElementKind:atIndexPath: on ASCollectionView. Assert non-nil for usage of ASCollectionDataControllers -supplementaryNodeOfKind:atIndexPath: within ASCollectionView 2016-06-27 11:05:53 -04:00
Colin McArdell and Robin Chou
d69dd880a5 Exposing supplementaryNodeOfKind:atIndexPath: in the ASCollectionView interface. 2016-06-27 11:05:11 -04:00
Gareth Reese
d55621c285 [ASCollectionView] Tuning parameters not set 2016-06-27 14:07:00 +01:00
Hannah Trosi
2e4b1ea053 [ASCellNode] Fix selection / highlight implementation 2016-06-25 00:22:28 -07:00
Adlai Holler
9c70cec8d8 Improve update handling more 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
Michael Schneider
f0bfa24fa3 Merge pull request #1766 from hannahmbanana/collectionLayout
[ASCollectionView, ASCellNode] Add support applyLayoutAttributes: on ASCellNode
2016-06-23 15:09:10 -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
46421f8684 [ASCollectionView] support UICollectionViewLayoutAttributes 2016-06-17 10:17:52 -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
4804f429b9 Revert "[ASCollectionView] Add a "Null Object" for a layout inspector if custom layout is given but no layout inspector" (#1713) 2016-06-04 22:49:10 -07:00
appleguy
87575b78ee [ASCellNode] Adding support for scroll view begin / end drag to VisibilityEvent changes. 2016-06-04 22:14:08 -07:00
Michael Schneider
00d9372ee4 Add a "Null Object" for a layout inspector if no no flow layout is given
The purpose of the ASCollectionViewCustomLayoutInspector is to provide a default implementation if given a custom layout, but no layout inspector.
2016-06-04 13:58:23 -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
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
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
d9f16e0acf Use _performingBatchUpdates for _layoutFacilitator batched parameter 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
3c66013088 Remove logging message 2016-04-10 14:23:33 -07:00
Michael Schneider
e9fe92444f Small comment fix 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
c25a252e1c Fix fetch call won't occur for content smaller than bounds unless user scrolls 2016-04-09 10:55:52 -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
Hannah Troisi
f9a92366d3 [AsyncDisplayKit] Fix build so we can weak link AVFoundation
Unclear why the framework target required these seemingly unrelated changes to Collection
classes, but I modeled them after related files and it seems cleaner now (passes tests & framework target)
2016-03-19 17:54:02 -07:00
appleguy
2ad9d83520 Merge pull request #1353 from ejensen/spelling
[Documentation] Correct spelling errors
2016-03-16 22:53:15 -07:00
Michael Schneider
e82118e72f Add assertion for ASDisplayNode is layer backed if using ASInterfaceStateForDisplayNode 2016-03-16 16:27:08 -07:00
Michael Schneider
8d771f930a Refactor calculation of interface state based on ASDisplayNode and window 2016-03-16 13:26:17 -07:00