diff --git a/AsyncDisplayKit/Layout/ASLayout.h b/AsyncDisplayKit/Layout/ASLayout.h index 7733a6a207..0d0bcfa281 100644 --- a/AsyncDisplayKit/Layout/ASLayout.h +++ b/AsyncDisplayKit/Layout/ASLayout.h @@ -68,6 +68,12 @@ extern BOOL CGPointIsNull(CGPoint point); */ @property (nonatomic, readonly, getter=isFlattened) BOOL flattened; +/** + * @abstract Returns a valid frame for the current layout computed with the size and position. + * @discussion Clamps the layout's origin or position to 0 if any of the calculated values are infinite. + */ +@property (nonatomic, readonly) CGRect frame; + /** * Initializer. * @@ -142,12 +148,6 @@ extern BOOL CGPointIsNull(CGPoint point); */ - (ASLayout *)flattenedLayoutUsingPredicateBlock:(BOOL (^)(ASLayout *evaluatedLayout))predicateBlock; -/** - * @abstract Returns a valid frame for the current layout computed with the size and position. - * @discussion Clamps the layout's origin or position to 0 if any of the calculated values are infinite. - */ -- (CGRect)frame; - @end NS_ASSUME_NONNULL_END diff --git a/AsyncDisplayKit/Layout/ASLayout.mm b/AsyncDisplayKit/Layout/ASLayout.mm index d715e45a48..e5f0cd1778 100644 --- a/AsyncDisplayKit/Layout/ASLayout.mm +++ b/AsyncDisplayKit/Layout/ASLayout.mm @@ -24,6 +24,8 @@ extern BOOL CGPointIsNull(CGPoint point) @implementation ASLayout +@dynamic frame; + + (instancetype)layoutWithLayoutableObject:(id)layoutableObject constrainedSizeRange:(ASSizeRange)sizeRange size:(CGSize)size