mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-28 14:10:44 +00:00
fix warning 'multiple methods length found'
* method accepts either NSStrings and NSAttributedString: assert on that * explicitly cast to NSAttributedString to get rid of ambiguity warning
This commit is contained in:
parent
d3696e5c4f
commit
3c25f25945
@ -686,12 +686,15 @@ static inline NSAttributedString * NSAttributedStringBySettingColorFromContext(N
|
|||||||
[self setText:text afterInheritingLabelAttributesAndConfiguringWithBlock:nil];
|
[self setText:text afterInheritingLabelAttributesAndConfiguringWithBlock:nil];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
NSAssert([text isKindOfClass:[NSAttributedString class]], @"TTTAttributedLabel accepts either NSStrings or NSAttributedStrings");
|
||||||
self.attributedText = text;
|
NSAttributedString *attributedString = text;
|
||||||
|
self.attributedText = attributedString;
|
||||||
|
|
||||||
self.links = [NSArray array];
|
self.links = [NSArray array];
|
||||||
if (self.dataDetectorTypes != UIDataDetectorTypeNone) {
|
if (self.dataDetectorTypes != UIDataDetectorTypeNone) {
|
||||||
for (NSTextCheckingResult *result in [self detectedLinksInString:[self.attributedText string] range:NSMakeRange(0, [text length]) error:nil]) {
|
for (NSTextCheckingResult *result in [self detectedLinksInString:[self.attributedText string]
|
||||||
|
range:NSMakeRange(0, [attributedString length])
|
||||||
|
error:nil]) {
|
||||||
[self addLinkWithTextCheckingResult:result];
|
[self addLinkWithTextCheckingResult:result];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user