File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ typedef enum{
74
74
/* Target label obejct, default self if you do not initWithLabel nor set*/
75
75
@property (nonatomic,strong) UILabel *timeLabel;
76
76
77
+ /* Used for replace text in range */
78
+ @property (nonatomic, assign) NSRange textRange;
79
+
77
80
/* Type to choose from stopwatch or timer*/
78
81
@property (assign) MZTimerLabelType timerType;
79
82
Original file line number Diff line number Diff line change @@ -364,7 +364,12 @@ -(void)updateLabel{
364
364
self.dateFormatter .dateFormat = originalTimeFormat;
365
365
// 0.4.7 added---endb//
366
366
}else {
367
- self.timeLabel .text = [self .dateFormatter stringFromDate: timeToShow];
367
+ if (self.textRange .length > 0 ){
368
+ NSString * labelText = [self .text stringByReplacingCharactersInRange: self .textRange withString: [self .dateFormatter stringFromDate: timeToShow]];
369
+ self.timeLabel .text = labelText;
370
+ } else {
371
+ self.timeLabel .text = [self .dateFormatter stringFromDate: timeToShow];
372
+ }
368
373
}
369
374
}
370
375
You can’t perform that action at this time.
0 commit comments