mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[Layout] Improve Layout System Abstraction (#2941)
* Improve Layout Abstraction * Address naming comments - Rename ASPrimitiveTraitEnvironment to ASTraitEnvironment - Rename ASPrimitiveTraitCollectionPropagateDown to ASTraitCollectionPropagateDown - Rename progagateNewPrimitiveTraitCollection: to propagateNewTraitCollection:
This commit is contained in:
committed by
GitHub
parent
a2ff2b9900
commit
12e4e5b048
@@ -6,8 +6,15 @@
|
||||
// Copyright © 2016 Facebook. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASAvailability.h>
|
||||
#import <AsyncDisplayKit/ASObjectDescriptionHelpers.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#if AS_TARGET_OS_IOS
|
||||
#import <UIKit/UIGeometry.h>
|
||||
#else
|
||||
#import <Foundation/NSGeometry.h>
|
||||
#endif
|
||||
|
||||
#import <AsyncDisplayKit/NSIndexSet+ASHelpers.h>
|
||||
|
||||
NSString *ASGetDescriptionValueString(id object)
|
||||
@@ -16,6 +23,7 @@ NSString *ASGetDescriptionValueString(id object)
|
||||
// Use shortened NSValue descriptions
|
||||
NSValue *value = object;
|
||||
const char *type = value.objCType;
|
||||
|
||||
if (strcmp(type, @encode(CGRect)) == 0) {
|
||||
CGRect rect = [value CGRectValue];
|
||||
return [NSString stringWithFormat:@"(%g %g; %g %g)", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height];
|
||||
@@ -24,6 +32,7 @@ NSString *ASGetDescriptionValueString(id object)
|
||||
} else if (strcmp(type, @encode(CGPoint)) == 0) {
|
||||
return NSStringFromCGPoint(value.CGPointValue);
|
||||
}
|
||||
|
||||
} else if ([object isKindOfClass:[NSIndexSet class]]) {
|
||||
return [object as_smallDescription];
|
||||
} else if ([object isKindOfClass:[NSIndexPath class]]) {
|
||||
|
||||
Reference in New Issue
Block a user