Summary:
The old assignment of `self.node.environmentTraitCollection.containerSize = windowSize;` doesn't because the struct creates a copy and then assigns `windowSize` to that copy.
Also realized that we need to create a new `ASEnvironmentTraitCollection` in `willTransitionToTraitCollection:withTransitionCoordinator`:. If we only update in `viewWillTransitionToSize:` we will only update the `containerSize` value in `self.environmentTraitCollection` as we don't have the new trait collection yet.
Differential Revision: https://phabricator.pinadmin.com/D101807
It appears that didMoveToViewController: can be called with nil,
yet self.parentViewController will *not* be nil. This can result
in calling parent view controller's visibility depth. Instead of
asserting, these methods should return NSNotFound which also happens
to be a really large number, effectively infinite depth.
Passing around a pointer was leading to crashes as the ASVC was the sole owner of the context. There are cases where the VC would dealloc while its subnodes were laying out. This could lead to the subnodes accessing a garbage pointer.
* 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.
* [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
* [AsyncDisplayKit+Utilities.h] UIImage category for performant (optionally rounded) flat color stretchable images
* treat clear background color as no background color (D99117)
* add borderWidth
* add several shorter methods per Scott's comment
* rename files and add to AsyncDisplayKit.h
* fix xcode project file
* update commentse
This situation is relatively uncommon. If a user manually uses -[UIView addSubnode:], the convenience category method,
and then calls -[ASDisplayNode removeFromSuperview] -- we would bypass performing the actual removal as no supernode pointer
is set. After further consideration, the special handling here to support divergence between the supernode pointer and
the view / layer hierarchy is not something we need to maintain going forward, and removing it makes addressing this easy.
Currently measurement always needs to happen on the main thread if implicit hierarchy management is enabled as adding and removing from nodes needs to happen on the main thread. We now will trampoline to the main thread to do the insertion and deletion of nodes.
This also resolves the issue that can occur if a node is already loaded deep in the layout hierarchy in the layout that the node is transforming to. Before insertion or deletion is happening we need to crawl the layout hierarchy to check that though.