* Safer checks in ASDisplayNode’s setFrame before assigning bounds and position
* Consolidate checks in one place
* Assert with ASDisplayNodeNonFatal
* Allow position to be negative
* [Yoga + AsyncDisplayKit] Initial commit for supporting Yoga-powered layout calculation.
Because this results in ASLayout objects, it preserve support for automaticallyManagesSubnodes
as well as the animated transition system. More work remains to vet performance of the new mode,
and it will remain in +Beta for the forseeable future.
I'm not sure that this should ever be used as the primary ASDK layout system, but it should remain an
option for some apps to experiment with if they require an implementation that more strictly mirrors
W3C standard Flexbox.
* [Yoga] Improve usage of ASHierarchyState to ensure simultaneous yoga layouts can't happen.
* [Yoga] Strictly minimize the impact of the Yoga integration on existing code.
Created new file ASDisplayNode+Yoga.mm, reduced size and number of integration points in core code.
* [Yoga] Figured out how to further reduce ASDisplayNode.mm impact by allocating _yogaNode in property accessor, and changing all accesses to use the property.
* Rejigger our flow layout supplementary support to make more sense.
* Support old protocol
* Update
* Update deprecation message
* Undeprecate insetForSection method, because it actually _does_ still work
* Update the tests
* Remove irrelevant junk
* Remove cast, add pragma
* Remove duplicate import
* Move `ASLayoutController` related code out of CoreGraphics+ASConvenience
* Further cleanup
* Move private layout files to Privat/Layout
* Move ASLayoutElementStylePrivate into Private/Layout
* Further cleanup
* Move tvOS related files to tvOS folder
* Further cleanup
* [ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize.
This feature has been desired for a long time, and has turned out to be phenomenally useful and easy to use.
It works well either for a blank ASScrollNode with .layoutSpecBlock set on it, or a subclass of ASScrollNode with a more
traditional layoutSpecThatFits: implementation. With this approach there is no need to capture the layout size, use
an Absolute layout spec as a wrapper, or set contentSize anywhere in the code and it will update as the layout changes!
There is no automatic management of contentInset, but it would make sense to add this with keyboard listeners in the future.
* [ASScrollNode] Add locking to new properties, adjust how calculateLayout override is done.
* Deprecations should be re-enabled. If there are specific deprecations we'd like to hold off on, we should address those specifically.
* Fix decleration
* Move select to undeprecated
* Fix deprecations
This reverts commit 1165628905f92aa00c1605230f32953f5d7f0670.
I wanted to catch dimension issues early, we should move the assert to setting
width and height. The former was correct for here.
* Remove set layout style size helper
* Update API to set and get a CGSize / ASRelativeSize from an ASLayoutElementStyle
- Expose ASRelativeSize type
- Add new helper properties to set a size / relative size to ASLayoutElementStyle
- Don't expose the size in ASLayoutElementStyle anymore and move into ASLayoutElementStylePrivate
* Update examples
* Update comments for size helpers
* [Layout API] Rename ASLayoutable to ASLayoutElement
* arg
* fix wrapperWithLayoutElement
* [Layout API] Rename ASLayoutable to ASLayoutElement
* arg
* address Michael's comments
* Remove ASLayoutValidation files that were deleted on master since this diff was created.
* 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
These conditions already had assertions, but at runtime, an insufficiently tested and incorrect ASLayoutSpec could
generate values that cause UIKit to enter an infinite loop (e.g. inside of UICollectionView layout validation).
- ASRelativeSize and ASRelativeSizeRange are used only by ASStaticLayoutNode. They are declared in a standalone header.
- ASDimension contains a minimal set of new size types required to use the common layouts. Thus minimize the learning curve.
- The code is forked from LayoutComponents in ComponentKit.
- Public interfaces are modified to be strictly Objective-C. As a result, users are not forced to switch to Objective-C++, the linker can happily compile and Swift fans can continue using the mighty ASDK.