Skip to content

Commit c22bfad

Browse files
committed
Added an example how to use attributes in textRange
1 parent 77d8be3 commit c22bfad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

MZTimerLabelDemo/MZTimerLabelDemo/MZTLViewController.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ - (void)viewDidLoad
153153
[timerExample13 setCountDownTime:999];
154154
NSString* text = @"timer here in text";
155155
NSRange r = [text rangeOfString:@"here"];
156+
157+
UIColor* fgColor = [UIColor redColor];
158+
NSDictionary* attributesForRange = @{
159+
NSForegroundColorAttributeName: fgColor,
160+
};
161+
timerExample13.attributedDictionaryForTextInRange = attributesForRange;
156162
timerExample13.text = text;
157163
timerExample13.textRange = r;
158164
timerExample13.timeFormat = @"ss";

0 commit comments

Comments
 (0)