560 Commits

Author SHA1 Message Date
Garrett Moon
7358fa9182 Missed #def ing out the header I guess? 2016-06-06 12:33:50 -07: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
Michael Schneider
7d902d98c9 Fix passing wrong constrained size to nodes
In _layoutNodesFromContexts:ofKind:completion: we pass the full array of contexts to _layoutNodes:fromContexts:atIndexesOfRange:ofKind: but for nodes we pass a subarray of nodes instead based on the batchCount. As batchRange we always start from 0 to batchCount. We now use the same indexes that we use to create the subarray of nodes to get a subarray of contexts that we pass to _layoutNodes:fromContexts:atIndexesOfRange:ofKind:.
2016-05-13 21:06:16 +02:00
Henish Shah
8e38e225c8 [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 11:51:01 -04:00
appleguy
efc81f5a1c Merge pull request #1592 from rcancro/displayTraits
[ASViewController] Add support for ASTraitCollection
2016-05-11 21:19:55 -07:00
rcancro
cfa9dcda56 typo and comment 2016-05-11 14:08:06 -07:00
rcancro
4b54144f55 Levi's comments 2016-05-11 10:21:11 -07:00
Levi McCallum
905f3a23b0 Create a new hash table on commit to prevent copy
Resolves #1342
2016-05-10 15:00:31 -07:00
rcancro
9d622c7eac changed DisplayTraits to TraitCollection 2016-05-10 14:45:03 -07:00
rcancro
a04cbb6e4f include displayContext in equality check 2016-05-10 14:44:48 -07:00
rcancro
f828d079fa added nsobject based ASDisplayTraits class 2016-05-10 14:44:43 -07:00
rcancro
35820e58a0 add locking to collection state propagation 2016-05-10 14:44:37 -07:00
rcancro
b4a6f87ca6 addressed some comments 2016-05-10 14:44:32 -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
appleguy
a1d2f8ccc6 Merge pull request #1571 from maicki/FixASPagerNodeDataSourceSourceInconsistency
[ASPagerNode] Fix ASPagerNode data source and delegate inconsistencies
2016-05-10 13:44:39 -07:00
appleguy
d88e170163 Merge pull request #1624 from maicki/FixDelegateProxyCrash
[Accessibility / iOS 8] Fix 8.0 and 8.1-only, VoiceOver crash when clearing delegate / dataSource for Table or Collection
2016-05-10 13:43:40 -07:00
Adlai Holler
f9cd9730f7 Add nullability to ASPINRemoteImageDownloader.h 2016-05-07 15:55:00 -07:00
Adlai Holler
2e2ebe8c08 [ASPINRemoteImageDownloader] Replace instancetype with actual class name for shared instance 2016-05-07 15:53:28 -07:00
Adlai Holler
33d0919b1f [ASImageProtocols] Be smarter about nullability with image downloader protocol 2016-05-07 15:50:03 -07:00
Adlai Holler
68e324d2d0 Improve commentary 2016-05-07 15:18:11 -07:00
Adlai Holler
fab117b824 [ASPINRemoteImageDownloader] Call download progress handler 2016-05-07 15:14:30 -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
298b9a2be7 Fix ASPagerNode data source and delegate inconsistencies
- Change ASPagerNodeDataSource -> ASPagerDataSource
- Add ASPagerDelegate
2016-05-04 21:03:13 -07:00
Wendy
0b55df9649 Add the ability for ASNetworkImageNodes to keep track of their progressive image quality 2016-04-26 18:33:59 -07:00
Michael Schneider
2ab82f5995 Move to fast enumeration for iterating through an array
We move from block based enumeration for the array to fast enumeration as from a benchmark perspective this is faster. For the dictionary we stay with block based enumeration as looking up the value for the key in e.g. fast enumeration would be slower as using the block based API where we get the key and value for passed in
2016-04-26 10:45:35 -07:00
appleguy
74b866e6ba Merge pull request #1559 from garrettmoon/upstream-GIF-Cleanup
[ASImageNode] Follow up to animated GIF PR
2016-04-19 16:43:49 -07:00