You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
754 B

//
// TYLinkTextStorage.m
// TYAttributedLabelDemo
//
// Created by tanyang on 15/4/8.
// Copyright (c) 2015tanyang. All rights reserved.
//
#import "TYLinkTextStorage.h"
@implementation TYLinkTextStorage
- (instancetype)init
{
if (self = [super init]) {
self.underLineStyle = kCTUnderlineStyleSingle;
self.modifier = kCTUnderlinePatternSolid;
}
return self;
}
#pragma mark - protocol
- (void)addTextStorageWithAttributedString:(NSMutableAttributedString *)attributedString
{
[super addTextStorageWithAttributedString:attributedString];
[attributedString addAttribute:kTYTextRunAttributedName value:self range:self.range];
self.text = [attributedString.string substringWithRange:self.range];
}
@end