@@ -437,6 +437,77 @@ - (CGPoint)layoutPosition
437437 return _layoutPosition.load ();
438438}
439439
440+ #pragma mark - Debugging
441+
442+ - (NSString *)description
443+ {
444+ return ASObjectDescriptionMake (self, [self propertiesForDescription ]);
445+ }
446+
447+ - (NSMutableArray <NSDictionary *> *)propertiesForDescription
448+ {
449+ NSMutableArray <NSDictionary *> *result = [NSMutableArray array ];
450+
451+ if ((self.minLayoutSize .width .unit != ASDimensionUnitAuto ||
452+ self.minLayoutSize .height .unit != ASDimensionUnitAuto)) {
453+ [result addObject: @{ @" minLayoutSize" : NSStringFromASLayoutSize(self.minLayoutSize ) }];
454+ }
455+
456+ if ((self.preferredLayoutSize .width .unit != ASDimensionUnitAuto ||
457+ self.preferredLayoutSize .height .unit != ASDimensionUnitAuto)) {
458+ [result addObject: @{ @" preferredSize" : NSStringFromASLayoutSize(self.preferredLayoutSize ) }];
459+ }
460+
461+ if ((self.maxLayoutSize .width .unit != ASDimensionUnitAuto ||
462+ self.maxLayoutSize .height .unit != ASDimensionUnitAuto)) {
463+ [result addObject: @{ @" maxLayoutSize" : NSStringFromASLayoutSize(self.maxLayoutSize ) }];
464+ }
465+
466+ const ASEnvironmentLayoutOptionsState defaultState = ASEnvironmentLayoutOptionsStateMakeDefault ();
467+
468+ if (self.alignSelf != defaultState.alignSelf ) {
469+ [result addObject: @{ @" alignSelf" : [@[@" ASStackLayoutAlignSelfAuto" ,
470+ @" ASStackLayoutAlignSelfStart" ,
471+ @" ASStackLayoutAlignSelfEnd" ,
472+ @" ASStackLayoutAlignSelfCenter" ,
473+ @" ASStackLayoutAlignSelfStretch" ] objectAtIndex: self .alignSelf] }];
474+ }
475+
476+ if (self.ascender != defaultState.ascender ) {
477+ [result addObject: @{ @" ascender" : @(self.ascender ) }];
478+ }
479+
480+ if (self.descender != defaultState.descender ) {
481+ [result addObject: @{ @" descender" : @(self.descender ) }];
482+ }
483+
484+ if (ASDimensionEqualToDimension (self.flexBasis , defaultState.flexBasis ) == NO ) {
485+ [result addObject: @{ @" flexBasis" : NSStringFromASDimension(self.flexBasis ) }];
486+ }
487+
488+ if (self.flexGrow != defaultState.flexGrow ) {
489+ [result addObject: @{ @" flexGrow" : @(self.flexGrow ) }];
490+ }
491+
492+ if (self.flexShrink != defaultState.flexShrink ) {
493+ [result addObject: @{ @" flexShrink" : @(self.flexShrink ) }];
494+ }
495+
496+ if (self.spacingAfter != defaultState.spacingAfter ) {
497+ [result addObject: @{ @" spacingAfter" : @(self.spacingAfter ) }];
498+ }
499+
500+ if (self.spacingBefore != defaultState.spacingBefore ) {
501+ [result addObject: @{ @" spacingBefore" : @(self.spacingBefore ) }];
502+ }
503+
504+ if (CGPointEqualToPoint (self.layoutPosition , defaultState.layoutPosition ) == NO ) {
505+ [result addObject: @{ @" layoutPosition" : [NSValue valueWithCGPoint: self .layoutPosition] }];
506+ }
507+
508+ return result;
509+ }
510+
440511#pragma mark Deprecated
441512
442513#pragma clang diagnostic push
0 commit comments