mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Put all ascii box methods into a Debugging category.
This commit is contained in:
@@ -48,7 +48,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
||||
*
|
||||
*/
|
||||
|
||||
@interface ASDisplayNode : ASDealloc2MainObject <ASLayoutable, ASLayoutableAsciiArtProtocol>
|
||||
@interface ASDisplayNode : ASDealloc2MainObject <ASLayoutable>
|
||||
|
||||
|
||||
/** @name Initializing a node object */
|
||||
@@ -659,6 +659,9 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
||||
- (void)addSubnode:(ASDisplayNode *)node;
|
||||
@end
|
||||
|
||||
@interface ASDisplayNode (Debugging) <ASLayoutableAsciiArtProtocol>
|
||||
@end
|
||||
|
||||
@interface ASDisplayNode (Deprecated)
|
||||
|
||||
- (void)reclaimMemory ASDISPLAYNODE_DEPRECATED;
|
||||
|
||||
@@ -2074,19 +2074,6 @@ static void _recursivelySetDisplaySuspended(ASDisplayNode *node, CALayer *layer,
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - ASLayoutableAsciiArtProtocol
|
||||
|
||||
- (NSString *)asciiArtString
|
||||
{
|
||||
return [ASLayoutSpec asciiArtStringForChildren:@[] parentName:[self asciiArtName]];
|
||||
}
|
||||
|
||||
- (NSString *)asciiArtName
|
||||
{
|
||||
return NSStringFromClass([self class]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASDisplayNode (Debugging)
|
||||
@@ -2150,6 +2137,18 @@ static void _recursivelySetDisplaySuspended(ASDisplayNode *node, CALayer *layer,
|
||||
return subtree;
|
||||
}
|
||||
|
||||
#pragma mark - ASLayoutableAsciiArtProtocol
|
||||
|
||||
- (NSString *)asciiArtString
|
||||
{
|
||||
return [ASLayoutSpec asciiArtStringForChildren:@[] parentName:[self asciiArtName]];
|
||||
}
|
||||
|
||||
- (NSString *)asciiArtName
|
||||
{
|
||||
return NSStringFromClass([self class]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
// We use associated objects as a last resort if our view is not a _ASDisplayView ie it doesn't have the _node ivar to write to
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#import <AsyncDisplayKit/ASAsciiArtBoxCreator.h>
|
||||
|
||||
/** A layout spec is an immutable object that describes a layout, loosely inspired by React. */
|
||||
@interface ASLayoutSpec : NSObject <ASLayoutable, ASLayoutableAsciiArtProtocol>
|
||||
@interface ASLayoutSpec : NSObject <ASLayoutable>
|
||||
|
||||
/**
|
||||
* Creation of a layout spec should only happen by a user in layoutSpecThatFits:. During that method, a
|
||||
@@ -95,7 +95,9 @@
|
||||
|
||||
/** Returns all children added to this layout spec. */
|
||||
- (NSArray *)children;
|
||||
@end
|
||||
|
||||
@interface ASLayoutSpec (Debugging) <ASLayoutableAsciiArtProtocol>
|
||||
/**
|
||||
* Used by other layout specs to create ascii art debug strings
|
||||
*/
|
||||
|
||||
@@ -122,6 +122,10 @@ static NSString * const kDefaultChildrenKey = @"kDefaultChildrenKey";
|
||||
return self.layoutChildren[kDefaultChildrenKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASLayoutSpec (Debugging)
|
||||
|
||||
#pragma mark - ASLayoutableAsciiArtProtocol
|
||||
|
||||
+ (NSString *)asciiArtStringForChildren:(NSArray<id<ASLayoutableAsciiArtProtocol>> *)children parentName:(NSString *)parentName direction:(ASStackLayoutDirection)direction
|
||||
|
||||
@@ -72,6 +72,10 @@ static NSString * const kOverlayChildKey = @"kOverlayChildKey";
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASOverlayLayoutSpec (Debugging)
|
||||
|
||||
#pragma mark - ASLayoutableAsciiArtProtocol
|
||||
|
||||
- (NSString *)debugBoxString
|
||||
|
||||
@@ -86,6 +86,10 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASRatioLayoutSpec (Debugging)
|
||||
|
||||
#pragma mark - ASLayoutableAsciiArtProtocol
|
||||
|
||||
- (NSString *)asciiArtName
|
||||
|
||||
@@ -135,6 +135,10 @@
|
||||
sublayouts:sublayouts];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASStackLayoutSpec (Debugging)
|
||||
|
||||
#pragma mark - ASLayoutableAsciiArtProtocol
|
||||
|
||||
- (NSString *)asciiArtString
|
||||
|
||||
@@ -84,6 +84,10 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ASStaticLayoutSpec (Debugging)
|
||||
|
||||
#pragma mark - ASLayoutableAsciiArtProtocol
|
||||
|
||||
- (NSString *)debugBoxString
|
||||
|
||||
Reference in New Issue
Block a user