mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[ASTextNode] Actually deprecate attributedString property (#2151)
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
|
||||
_countNode = [[ASTextNode alloc] init];
|
||||
if (_commentsCount > 0) {
|
||||
_countNode.attributedString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%zd", _commentsCount] attributes:[TextStyles cellControlStyle]];
|
||||
_countNode.attributedText = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%zd", _commentsCount] attributes:[TextStyles cellControlStyle]];
|
||||
}
|
||||
[self addSubnode:_countNode];
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
if (_likesCount > 0) {
|
||||
|
||||
NSDictionary *attributes = _liked ? [TextStyles cellControlColoredStyle] : [TextStyles cellControlStyle];
|
||||
_countNode.attributedString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld", (long)_likesCount] attributes:attributes];
|
||||
_countNode.attributedText = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%ld", (long)_likesCount] attributes:attributes];
|
||||
|
||||
}
|
||||
[self addSubnode:_countNode];
|
||||
|
||||
@@ -52,13 +52,13 @@
|
||||
|
||||
// Name node
|
||||
_nameNode = [[ASTextNode alloc] init];
|
||||
_nameNode.attributedString = [[NSAttributedString alloc] initWithString:_post.name attributes:[TextStyles nameStyle]];
|
||||
_nameNode.attributedText = [[NSAttributedString alloc] initWithString:_post.name attributes:[TextStyles nameStyle]];
|
||||
_nameNode.maximumNumberOfLines = 1;
|
||||
[self addSubnode:_nameNode];
|
||||
|
||||
// Username node
|
||||
_usernameNode = [[ASTextNode alloc] init];
|
||||
_usernameNode.attributedString = [[NSAttributedString alloc] initWithString:_post.username attributes:[TextStyles usernameStyle]];
|
||||
_usernameNode.attributedText = [[NSAttributedString alloc] initWithString:_post.username attributes:[TextStyles usernameStyle]];
|
||||
_usernameNode.flexShrink = YES; //if name and username don't fit to cell width, allow username shrink
|
||||
_usernameNode.truncationMode = NSLineBreakByTruncatingTail;
|
||||
_usernameNode.maximumNumberOfLines = 1;
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
// Time node
|
||||
_timeNode = [[ASTextNode alloc] init];
|
||||
_timeNode.attributedString = [[NSAttributedString alloc] initWithString:_post.time attributes:[TextStyles timeStyle]];
|
||||
_timeNode.attributedText = [[NSAttributedString alloc] initWithString:_post.time attributes:[TextStyles timeStyle]];
|
||||
[self addSubnode:_timeNode];
|
||||
|
||||
// Post node
|
||||
@@ -98,7 +98,7 @@
|
||||
_postNode.delegate = self;
|
||||
_postNode.userInteractionEnabled = YES;
|
||||
_postNode.linkAttributeNames = @[ kLinkAttributeName ];
|
||||
_postNode.attributedString = attrString;
|
||||
_postNode.attributedText = attrString;
|
||||
_postNode.passthroughNonlinkTouches = YES; // passes touches through when they aren't on a link
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user