* Initial commit for adding a size constraint to ASLayoutable's
* Some more commits
* Fix sample projects in extra/
* Remove preferredFrameSize test of ASEditableTextNode
* Remove preferredFrameSize from examples_extra
* Add deprecation warning to -[ASDisplayNode preferredFrameSize]
* Add deprecation warning to -[ASDisplayNode measureWithSizeRange:]
* Commit
* Commit
* Remove ASRelativeSizeRange
* Make ASRelativeSize private
* Adjust examples
* Improve setting of -[ASLayoutable size] with points or fractions
* Add ASWrapperLayoutSpec
* Improve creation of ASRelativeDimension
* Add `preferredFrameSize` back and add deprecated logging
* Add `layoutSpecBlock` setter and getter and add locking for it
* Add better documentation and fix macros to create ASRelativeDimension
* Create new ASSizeRangeMake with just a CGSize as parameter
* Update Kitten and Social App Layout example
* Add layoutThatFits: and deprecate measure:
* Rename ASRelativeDimension to ASDimension
* Fix examples for ASDimension renaming
* Remove fancy height and width setter
* Fix ASDimension helper
* Rename -[ASLayout layoutableObject] to -[ASLayout layoutable]
* Update layout related methods and more clearer documentation around how to use it
* Deprecate old ASLayout class constructors
* Don't unnecessary recalculate layout if constrained or parent size did not change
* Use shared pointer for ASDisplayNodeLayout
* Fix rebase conflicts
* Add documentation and move implementation in mm file of ASDisplayNodeLayout
* Fix test errors
* Rename ASSize to ASLayoutableSize
* Address comments
* Rename setSizeFromCGSize to setSizeWithCGSize
* Improve inline functions in ASDimension
* Fix rebase conflicts
* [ASTraitCollection] Fix 2 bugs dealing with trait propagation
* Don’t propagate on `viewWillTransitionToTraitCollection`. This is too early
* Pass the size from `viewWillTransitionToSize` as the container size in `traitCollectionDidChange`
* using the old trait collection’s size doesn’t actually make sense.
* Instead of propagating on viewWillTransitionToSize, do it in viewWillLayoutSubviews
* Add cache implementation
* Remove old ASEqualityHashHelpers
* Some more ASEquality and ASEqualityHashHelper cleanup
* Add cache for text renderer in ASTextNode
* Move from C++ LRU renderer cache to NSCache based renderer cache
* Add a mechanism to save attributed strings given to text nodes
* Setup performance tests to have an iteration variable
* Use realistic data in new text node performance test case
* Revert temporary changes
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.