We don't call the block on every subnode if the node that is passed in ASDisplayNodePerformBlockOnEveryNode has shouldRasterizeDescendants enabled as it tries to iterate through the sublayer hierarchy, but there are no sublayers
* Dealloc _pendingViewState if range managed
_ASPendingState objects can add up very quickly when adding
many nodes. This is especially an issue in large collection views
and table views. This needs to be weighed against the cost of
reallocing a _ASPendingState. So in range managed nodes we
delete the pending state, otherwise we just clear it.
* Adlai's comments
* Automatic measure pass in layout pass if not happened before
If no measure pass happened or the bounds changed between layout passes we manually trigger a measurement pass for the node using a size range equal to whatever bounds were provided to the node
* Add test method that ensures that on a second layout pass with same bounds, layoutSpecThatFits: / layoutSpecBlock is not called
* Attempt to reproduce supplementary crash
* Get closer with supplementary issue testing
* Alright! We have a repro!
* The investigation continues
* Fixed!
* Renamed range update callbacks
We finally settled on
didEnter/ExitDisplayState
didEnter/ExitPreloadState
didEnter/ExitVisibleState
This change is meant to unify the range update methods to relate to each
other and hopefully be a bit more self explanatory.
* Guarantee interface callbacks happen on main.
* move fetchData / clearFetchedData to default implementations
* Move deprecated methods to new deprecated category
* Don't bring in cocoapod change.
* Nits
* Capetalize
* Add failing test case
* [_ASDisplayLayer] If we skipped render due to being zero-size, enqueue a render when we get a real size
* Remove pointless import
* Fixes a deadlock caused by walking up the heirarchy.
* Use scope locker / unlocker and add a comment.
* Add comment about calling __setNeedsLayout without the lock.
Wait until all subnodes have the new trait collection before laying out the root node. The way I’m using `asyncTraitCollectionDidChange`, I sometimes call methods that call `setNeedsLayout` which causes a new layout pass to begin before the new trait collection has been propagated to all nodes. This leads to weird behavoir, like nodes being laid out twice in the same call stack!
This change won’t stop possibly unnecessary layout passes because of `asyncTraitCollectionDidChange`, but it will at least do a complete layout pass once we have propagated all traits.
Ultimately the solution to this problem (as Adlai pointed out) is to wait until the CA transaction commit to perform the actual layout.
* Add ability to force the size which an image node is rendered.
* Add unit tests for forced scaling.
* Whoops, need results!
* Round forced scaling.
* Check size of contents too.
* Remove unnecessary container node.
* Adds possibility to have custom annotation pins on static map. This resolves#1889.
* Removes wrong example for map annotations and adds some annotations to correct map example. #1889
* Static map node now uses specific property block to get annotation views.
* Changes self to strongSelf inside of the snapshotters completion block.
* MapNode: Adds statement in documentation.
* MapNode: Block for annotation view/image now returns UIImage and center offset is returned in inout param.
* MapNode and map example: Fixes from review.
* MapNode example: Gets image directly from custom annotation, without creating annotation view.
Previously we were only propagating the trait collection on `viewWillTransitionToSize` since it is called shortly after `willTransitionToTraitCollection`. However, some important things can happen in that time “shortly after” (like collection view layout). As long as nothing changes from `willTransitionToTraitCollection` to `viewWillTransitionToSize` (which it shouldn’t) the traits will not be re-propagated anyhow.
Also make sure to use the `ASEnvironmentTraitCollectionMakeDefault` method when creating new envTraitCollection so the struct isn’t filled with junk.
* Add unit test to confirm that supplementary items must be contained within actual sections
* [ASLayoutInspecting] Deprecate collectionView:numberOfSectionsForSupplementaryNodeOfKind:
* Add another test to dig deeper into UICollectionView
* I didn't really understand NSProxy
But I think I do now :)
Previously I inherited from NSObject because I didn't think I needed
anything fancy, but it turns out NSProxy is *less* fancy than NSObject
and allows for overriding more methods. This change is probably purely
academic in that we don't use this class to forward NSObject specific
messages, but I believe this is the 'right thing'.
* Update comment, thanks @maicki!
* Fixes issues with accessibility elements in scroll views
There are two changes here:
1. Because we can't reliably update the screen positions of accessibility elements
contained within a scroll view, we need to calculate them on demand, so we override
the accessibilityFrame method to do that.
2. Throwing away our calculated accessibility elements on frame change seemed to
cause the accessibility system to be confused.
Combining these two fixes together results in success, yay!
* Don't set the accessibilityFrame, getter is overridden.
* First approach to improve accessiblity
* Clear accessibleElements in addSubview: and willRemoveSubview:
* Adjust comments and rename viewNode to node
* Create new accessible elements if screen coordinates of view changes
* Remove legacy clearing of accessibleElements
* Performance improvements
* Use bounds for screenFrame calculation and indexOfObjectIdentical: in indexOfAccessiblityElement:
* Add ASDK_ACCESSIBILITY_DISABLE compiler flag to disable custom accessibility code in ASDK
* No need to set a frame if a subnode view is an accessibility element and not layer backed
* [ASTextNode] Fix highlighting when textContainerInsets are set.
* Add ASTextNodeSnapshotTests to xcodeproj.
* Add snapshot test for container inset and highlighting.