Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 7e4bf95

Browse files
maickiAdlai Holler
authored andcommitted
Move debugName into it’s own protocol out of the ASLayoutElement protocol (#2994)
1 parent aedac5c commit 7e4bf95

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

AsyncDisplayKit/ASDisplayNode.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#import <AsyncDisplayKit/ASBaseDefines.h>
1717
#import <AsyncDisplayKit/ASDimension.h>
1818
#import <AsyncDisplayKit/ASAsciiArtBoxCreator.h>
19+
#import <AsyncDisplayKit/ASObjectDescriptionHelpers.h>
1920
#import <AsyncDisplayKit/ASLayoutElement.h>
2021

2122
NS_ASSUME_NONNULL_BEGIN
@@ -558,7 +559,7 @@ extern NSInteger const ASDefaultDrawingPriority;
558559
/**
559560
* Convenience methods for debugging.
560561
*/
561-
@interface ASDisplayNode (Debugging) <ASLayoutElementAsciiArtProtocol>
562+
@interface ASDisplayNode (Debugging) <ASLayoutElementAsciiArtProtocol, ASDebugNameProvider>
562563

563564
/**
564565
* @abstract Return a description of the node hierarchy.

AsyncDisplayKit/Details/ASObjectDescriptionHelpers.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111

1212
NS_ASSUME_NONNULL_BEGIN
1313

14+
@protocol ASDebugNameProvider <NSObject>
15+
16+
@required
17+
/**
18+
* @abstract Name that is printed by ascii art string and displayed in description.
19+
*/
20+
@property (nullable, nonatomic, copy) NSString *debugName;
21+
22+
@end
23+
1424
/**
1525
* Your base class should conform to this and override `-debugDescription`
1626
* to call `[self propertiesForDebugDescription]` and use `ASObjectDescriptionMake`

AsyncDisplayKit/Layout/ASLayoutElement.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ ASDISPLAYNODE_EXTERN_C_END
8989
*/
9090
- (nullable NSArray<id<ASLayoutElement>> *)sublayoutElements;
9191

92-
/**
93-
* @abstract Optional name that is printed by ascii art string and displayed in description.
94-
*/
95-
@property (nullable, nonatomic, copy) NSString *debugName;
96-
9792
#pragma mark - Calculate layout
9893

9994
/**

AsyncDisplayKit/Layout/ASLayoutSpec.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#import <AsyncDisplayKit/ASLayoutElement.h>
1212
#import <AsyncDisplayKit/ASAsciiArtBoxCreator.h>
13+
#import <AsyncDisplayKit/ASObjectDescriptionHelpers.h>
1314

1415
NS_ASSUME_NONNULL_BEGIN
1516

@@ -91,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN
9192

9293
@end
9394

94-
@interface ASLayoutSpec (Debugging) <ASLayoutElementAsciiArtProtocol>
95+
@interface ASLayoutSpec (Debugging) <ASLayoutElementAsciiArtProtocol, ASDebugNameProvider>
9596
/**
9697
* Used by other layout specs to create ascii art debug strings
9798
*/

0 commit comments

Comments
 (0)