584 Commits

Author SHA1 Message Date
Adlai Holler
ebaa2c157e Remove aggregate CGRect initializers in ASDataController 2016-07-01 11:47:05 -07:00
Michael Schneider
8804342a98 Don't propagate trait collections to cells if the node is not loaded yet (#1833)
This fixes an issue where the propagation of trait collections trigger are creation of the node if the node view was not loaded yet.
2016-06-30 19:44:40 -07:00
Michael Schneider
f0e96cc808 Change @import to #import 2016-06-30 07:18:30 -07:00
Adlai Holler
284160b07b Merge pull request #1821 from maicki/MSAddConformsToProtocolToProxy
[ASDelegateProxy] Add `conformsToProtocol:`
2016-06-29 09:18:14 -07:00
Michael Schneider
4091d70003 Add conformsToProtocol: to ASDelegateProxy 2016-06-27 06:38:42 -07:00
Adlai Holler
0a354f8f4e [ASDataController] Remove implementation for unused hooks 2016-06-24 15:48:23 -07:00
Adlai Holler
0a525a3c16 [ASFlowLayoutController] Fix enumeration bug in ASFlowLayoutController 2016-06-24 13:52:16 -07:00
Adlai Holler
84e8b2686c [ASDataController] Combine isolated reloads into a batch 2016-06-24 13:03:51 -07:00
Adlai Holler
d8d2524b89 One more critical update integrity fix 2016-06-24 11:12:37 -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
ricky
997d37dc83 [ASEnvironment] Don't relayout as a result of clearing a traitCollection's context (#1759)
* Don't relayout as a result of clearing a traitCollection's context

I'm not completely sure this change is the best solution. Here is context:

An ASEnvironmentTraitCollection has a pointer to an optional context that an ASVC is the owner of. When the ASVC is dealloc'ed, we go through all subnodes of the VC and clear out the context so that the struct isn't holding on to a garbage pointer.

Setting the traitCollection on ASCollectionNode/ASTableNode causes the cells to relayout if the trait collection changed (this is  a special case for these two nodes since their cells are not actually subnodes). Setting the context to nil registered as a trait collection change and was causing a layout even as we were dealloc'ing the VC.

The logic I'm implementing here is:
If the trait collection changed AND the displayContext did not, then we should relayout.
If the trait collection changed AND the new displayContext is non-nil then we should layout
In the case where the trait collection change was caused soley by the displayContext going from non-nil to nil, then we should NOT layout.

```
// At this point we know that the two traits collections are NOT equal for some reason
BOOL needsLayout = (oldTraits.displayContext == currentTraits.displayContext) || currentTraits.displayContext != nil;
```

Is there a better place/safer way to do this?

* removed extra setNeedsLayout call
2016-06-23 20:07:45 -07:00
John Engelhart
ea64d7d09b Pr/fix unit tests memory leaks (#1795)
* Fix some concurrency problems detected by Xcode 8's new Thread Sanitizer.

Some of these changes are arguably just to silence the warnings from Thread Sanitizer.

* Fix several memory leaks in the unit tests.

A number of the unit test source files are compield with `-fno-objc-arc`.  This was clearly overlooked when writing several of the unit tests.

Fixed by (mostly) switching to use of `-autorelease` for the problem code.

NOTE: This commit doesn't fix all the memory leaks found.  There's still at least one leak in `-[ASDisplayNodeTests testSetNeedsDataFetchImmediateState]`, and several leaks in `ASBasicImageDownloader.mm`.  I wasn't able to find a trivial cause to these, unfortunately.
2016-06-22 16:56:53 -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
d547372a63 [Carthage] define PIN_REMOTE_IMAGE in .pch for non-CocoaPod users (#1797)
* [Carthage] define  PIN_REMOTE_IMAGE in PCH

* fixed ClassString
2016-06-22 15:37:00 -07:00
Michael Schneider
67055eecff Fix default tuning parameter for range mode ASLayoutRangeModeMinimum and range type ASLayoutRangeTypeFetchData 2016-06-13 17:03:36 -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
a7128cd213 Merge pull request #1605 from lappp9/override-callback-for-display-range
[ASDisplayNode] Added callbacks for entering and exiting fetch data and display ranges
2016-06-11 22:21:20 -07:00
appleguy
f72f39b445 Merge pull request #1726 from ejensen/local-animated-image
[ASNetworkImageNode] Support loading local animated images
2016-06-09 23:34:38 -07:00
Michael Schneider
1c6686e5d6 Improve rotation support for ASPagerNode 2016-06-09 15:46:08 -07:00
Eric Jensen
91e6df0af9 Add a way to check if data is in a format supported by a class implementing ASAnimatedImageProtocol 2016-06-09 10:36:18 -07:00
Garrett Moon
7358fa9182 Missed #def ing out the header I guess? 2016-06-06 12:33:50 -07:00
Luke Parham
fc5467b110 fixed typo and added backwards compatibility for 'visibilityDidChange' 2016-06-06 02:02:23 -05:00
Luke Parham
e510120031 changed '-visibilityDidChange:' to '-visiblieStateDidChange:' to match the others 2016-06-06 00:56:21 -05:00
Eric Horacek
70fbbe00a3 Whitespace 2016-06-05 21:55:57 -07:00
Eric Horacek
ed9fcdc2d7 Rebase 2016-06-05 21:53:04 -07:00
Eric Horacek
30dba283e2 Remove _pendingContexts dictionary mutation during enumeration 2016-06-05 21:43:05 -07:00
Eric Horacek
dc7f67c478 Populate more aggresively 2016-06-05 21:38:08 -07:00
Eric Horacek
fc5eef3269 Repopulate supplementary views on item-level changes
Currently within `ASCollectionView`, there is an assumption that there will always be a static number of supplementary views per section—even when additional items are added or removed from that section. This is evidenced by the fact that when you invoke -[ASCollectionView insertItemsAtIndexPaths:], the data source method -[ASCollectionDataSource collectionView:nodeForSupplementaryElementOfKind:atIndexPath:] is not invoked, preventing consumers from specifying a new number of supplementary nodes for the new set of items.

With this change, the set of supplementary nodes for a section is now recalculated not only on section-level mutations, but also on item-level mutations as well. This adds item-level counterparts to the section-level `-prepareFor...` subclassing hooks in `ASDataController+Subclasses.h` to make this possible.

This should fix #1278 and #1322

This has been tested in my project and seen to fix the assertion. Open to suggestions on how to test in a more universal way.
2016-06-05 21:38:08 -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
appleguy
c9b448bc95 Merge pull request #1674 from maicki/RefactorASCollectionViewLayoutInspectingUsage
[ASCollectionView] Add a "Null Object" for a layout inspector if custom layout is given but no layout inspector
2016-06-04 21:30:48 -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
Michael Schneider
6945555d60 Sort in ascending order before removing nodes and restore FIXME 2016-06-04 13:56:10 -07:00
Michael Schneider
6566b7adb7 Use asdk_inverseCompare: to reverse sort the array of index path's to delete 2016-06-04 13:56:10 -07:00
Michael Schneider
3e4b5e9e82 Sort index paths or rows in descendant order for deletion 2016-06-04 13:56:10 -07:00
Michael Schneider
45ff5634fe Use NSFastEnumeration for enumerating though eyes of completedNodes 2016-06-04 13:56:10 -07:00
Michael Schneider
f72261bd10 Remove comment and use sorted array for reloading data 2016-06-04 13:56:10 -07:00
appleguy
e5eed560e1 Merge pull request #1693 from rcancro/traitUpdate
[ASTraitCollection] Bug fixing/LayoutSpec propagation
2016-06-03 22:01:13 -07:00
ricky
13a35c5f2f more comments
* allow nil for setChild/children
* moved examples out of examples/
2016-06-03 13:59:59 -07:00
ricky
01dbc86778 First pass of comments
* make variable naming reflect ASEnvironmentTraitCollection vs ASTraitCollection
* move trait propagation to cell allocation instead of via a nested block
* move trait propagation when setting a displaynode's supernode instead of when adding a subnode
* fixed misspelling of "colection"
2016-06-03 09:59:24 -07:00
Rajinder Ramgarhia
1b7d68f63f [ASPINRemoteImageDownloader] Allows setting authentication challenge block 2016-05-31 10:06:54 -04:00
ricky
c42b0dd33a Remove explicit passing of trait collection to setChild/Children 2016-05-25 10:49:42 -07:00
ricky
59a26ee111 [ASTraitCollection] Bug fixing/LayoutSpec propagation
* Fixed bug in `ASEnvironmentMergeObjectAndState`
* New ASLayoutSpec methods for `setChild`/`setChildren`/`setChild:forIdentifier:` have been added to take in a trait collection.
* Added `setChild:`-like methods for ASLayoutSpecs take a traitCollection
* Fixed instances where nodes in a data controller were not getting their trait collections
* propagate traitCollection in ASDisplayNode on insertSubnode or addSubnode
2016-05-23 16:37:40 -07:00
appleguy
4cfe3f750a Merge pull request #1661 from maicki/MatchSubarrayContextsNodesCreation
[ASDataController] Match creation of subarrays for nodes and contexts in ASDataController
2016-05-13 23:47:41 -07:00
appleguy
50bdaa2442 Merge pull request #1658 from henish/ascollectionview_mutation_during_enumeration
[Sample] Resolve mutation during enumeration issue
2016-05-13 16:21:46 -07:00
Michael Schneider
eee2262262 Match creation of subarrays for nodes and contexts in ASDataController 2016-05-13 22:51:40 +02:00
Henish Shah
41a53887d7 [Sample] Resolve mutation during enumeration issue
- Mutating a dictionary using -enumerateKeysAndObjectsUsingBlock:
  can have unintended consequences.
- Using a copy of the keys to iterate over the values inside the
  dictionary instead.
2016-05-13 16:14:19 -04:00
Michael Schneider
33b76bbce0 Use calloc’d array for subarray of contexts 2016-05-13 21:38:25 +02:00