mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Add read-only names to UIView and CALayer
- Backed by name of the underlying ASDisplayNode. - Remove goofy usages of `setValue:forKey:` in ASDisplayNodeTests and ASDisplayNodeAppearanceTests.
This commit is contained in:
@@ -650,6 +650,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
||||
* @param node The node to be added.
|
||||
*/
|
||||
- (void)addSubnode:(ASDisplayNode *)node;
|
||||
- (NSString *)name;
|
||||
@end
|
||||
|
||||
/** CALayer(AsyncDisplayKit) defines convenience method for adding sub-ASDisplayNode to a CALayer. */
|
||||
@@ -660,6 +661,7 @@ typedef void (^ASDisplayNodeDidLoadBlock)(ASDisplayNode *node);
|
||||
* @param node The node to be added.
|
||||
*/
|
||||
- (void)addSubnode:(ASDisplayNode *)node;
|
||||
- (NSString *)name;
|
||||
@end
|
||||
|
||||
@interface ASDisplayNode (Deprecated)
|
||||
|
||||
@@ -2203,6 +2203,11 @@ static const char *ASDisplayNodeAssociatedNodeKey = "ASAssociatedNode";
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)name
|
||||
{
|
||||
return self.asyncdisplaykit_node.name;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CALayer (AsyncDisplayKit)
|
||||
@@ -2212,6 +2217,11 @@ static const char *ASDisplayNodeAssociatedNodeKey = "ASAssociatedNode";
|
||||
[self addSublayer:node.layer];
|
||||
}
|
||||
|
||||
- (NSString *)name
|
||||
{
|
||||
return self.asyncdisplaykit_node.name;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user