mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Small changes required by the coming layout debugger (#337)
* Small changes required by the layout debugger - `ASDisplayNode` can be told to not flatten its layout immediately but later on. The unflattened layout is also stored in a separate property. It's needed for inspecting not only display nodes but also layout specs used to compute a layout tree. - `ASLayout` can be told to always retain its sublayout elements. This is needed especially for layout specs since they are usually not retained after an ASLayout was computed. * Update CHANGELOG * Address comments
This commit is contained in:
@@ -553,6 +553,30 @@ extern NSInteger const ASDefaultDrawingPriority;
|
||||
*/
|
||||
@interface ASDisplayNode (Debugging) <ASDebugNameProvider>
|
||||
|
||||
/**
|
||||
* Set to YES to tell all ASDisplayNode instances to store their unflattened layouts.
|
||||
*
|
||||
* The layout can be accessed via `-unflattenedCalculatedLayout`.
|
||||
*
|
||||
* Flattened layouts use less memory and are faster to lookup. On the other hand, unflattened layouts are useful for debugging
|
||||
* because they preserve original information.
|
||||
*/
|
||||
+ (void)setShouldStoreUnflattenedLayouts:(BOOL)shouldStore;
|
||||
|
||||
/**
|
||||
* Whether or not ASDisplayNode instances should store their unflattened layouts.
|
||||
*
|
||||
* The layout can be accessed via `-unflattenedCalculatedLayout`.
|
||||
*
|
||||
* Flattened layouts use less memory and are faster to lookup. On the other hand, unflattened layouts are useful for debugging
|
||||
* because they preserve original information.
|
||||
*
|
||||
* Defaults to NO.
|
||||
*/
|
||||
+ (BOOL)shouldStoreUnflattenedLayouts;
|
||||
|
||||
@property (nonatomic, strong, readonly, nullable) ASLayout *unflattenedCalculatedLayout;
|
||||
|
||||
/**
|
||||
* @abstract Return a description of the node hierarchy.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user