mirror of
https://github.com/status-im/react-native.git
synced 2025-02-24 15:18:10 +00:00
[React Native] Implement -(recursiveD|d)escription for RCT(Shadow)View
This commit is contained in:
parent
5d6a89bc61
commit
3ce8b1a1c8
@ -20,4 +20,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)description
|
||||||
|
{
|
||||||
|
NSString *superDescription = super.description;
|
||||||
|
return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; text: %@>", self.text];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -54,6 +54,12 @@ static css_dim_t RCTMeasure(void *context, float width)
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)description
|
||||||
|
{
|
||||||
|
NSString *superDescription = super.description;
|
||||||
|
return [[superDescription substringToIndex:superDescription.length - 1] stringByAppendingFormat:@"; text: %@>", [self attributedString].string];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks
|
- (NSDictionary *)processUpdatedProperties:(NSMutableSet *)applierBlocks
|
||||||
parentProperties:(NSDictionary *)parentProperties
|
parentProperties:(NSDictionary *)parentProperties
|
||||||
{
|
{
|
||||||
|
@ -364,6 +364,34 @@ static void RCTProcessMetaProps(const float metaProps[META_PROP_COUNT], float st
|
|||||||
return self.reactTag;
|
return self.reactTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)description
|
||||||
|
{
|
||||||
|
NSString *description = super.description;
|
||||||
|
description = [[description substringToIndex:description.length - 1] stringByAppendingFormat:@"; viewName: %@; reactTag: %@; frame: %@>", self.viewName, self.reactTag, NSStringFromCGRect(self.frame)];
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)addRecursiveDescriptionToString:(NSMutableString *)string atLevel:(NSUInteger)level
|
||||||
|
{
|
||||||
|
for (NSUInteger i = 0; i < level; i++) {
|
||||||
|
[string appendString:@" | "];
|
||||||
|
}
|
||||||
|
|
||||||
|
[string appendString:self.description];
|
||||||
|
[string appendString:@"\n"];
|
||||||
|
|
||||||
|
for (RCTShadowView *subview in _reactSubviews) {
|
||||||
|
[subview addRecursiveDescriptionToString:string atLevel:level + 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *)recursiveDescription
|
||||||
|
{
|
||||||
|
NSMutableString *description = [NSMutableString string];
|
||||||
|
[self addRecursiveDescriptionToString:description atLevel:0];
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
// Margin
|
// Margin
|
||||||
|
|
||||||
#define RCT_MARGIN_PROPERTY(prop, metaProp) \
|
#define RCT_MARGIN_PROPERTY(prop, metaProp) \
|
||||||
|
@ -185,6 +185,14 @@ RCT_NOT_IMPLEMENTED(-initWithCoder:unused)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)description
|
||||||
|
{
|
||||||
|
NSString *superDescription = super.description;
|
||||||
|
NSRange semicolonRange = [superDescription rangeOfString:@";"];
|
||||||
|
NSString *replacement = [NSString stringWithFormat:@"; reactTag: %@;", self.reactTag];
|
||||||
|
return [superDescription stringByReplacingCharactersInRange:semicolonRange withString:replacement];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Statics for dealing with layoutGuides
|
#pragma mark - Statics for dealing with layoutGuides
|
||||||
|
|
||||||
+ (void)autoAdjustInsetsForView:(UIView<RCTAutoInsetsProtocol> *)parentView
|
+ (void)autoAdjustInsetsForView:(UIView<RCTAutoInsetsProtocol> *)parentView
|
||||||
|
Loading…
x
Reference in New Issue
Block a user