mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Move ASLayout frame to a computed property
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -24,6 +24,8 @@ extern BOOL CGPointIsNull(CGPoint point)
|
||||
|
||||
@implementation ASLayout
|
||||
|
||||
@dynamic frame;
|
||||
|
||||
+ (instancetype)layoutWithLayoutableObject:(id<ASLayoutable>)layoutableObject
|
||||
constrainedSizeRange:(ASSizeRange)sizeRange
|
||||
size:(CGSize)size
|
||||
|
||||
Reference in New Issue
Block a user