Skip to content

Commit c92b439

Browse files
authored
Merge pull request #84 from sunkehappy/master
[Refactor Code] Add strong class cast to remove warnings.
2 parents 121ced5 + 7b1a470 commit c92b439

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Classes/ProgressViews/M13ProgressViewSegmentedBar.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ - (void)performAction:(M13ProgressViewAction)action animated:(BOOL)animated
228228
[self setNeedsDisplay];
229229
[CATransaction begin];
230230
for (int i = 0; i < _numberOfSegments; i++) {
231-
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
231+
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
232232
CABasicAnimation *barAnimation = [self barColorAnimation];
233233
barAnimation.fromValue = (id)layer.fillColor;
234234
barAnimation.toValue = (id)[self colorForSegment:i].CGColor;
@@ -240,7 +240,7 @@ - (void)performAction:(M13ProgressViewAction)action animated:(BOOL)animated
240240
[self setNeedsDisplay];
241241
[CATransaction begin];
242242
for (int i = 0; i < _numberOfSegments; i++) {
243-
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
243+
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
244244
CABasicAnimation *barAnimation = [self barColorAnimation];
245245
barAnimation.fromValue = (id)layer.fillColor;
246246
barAnimation.toValue = (id)_successColor.CGColor;
@@ -252,7 +252,7 @@ - (void)performAction:(M13ProgressViewAction)action animated:(BOOL)animated
252252
[self setNeedsDisplay];
253253
[CATransaction begin];
254254
for (int i = 0; i < _numberOfSegments; i++) {
255-
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
255+
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
256256
CABasicAnimation *barAnimation = [self barColorAnimation];
257257
barAnimation.fromValue = (id)layer.fillColor;
258258
barAnimation.toValue = (id)_failureColor.CGColor;
@@ -450,7 +450,7 @@ - (void)drawProgress
450450
}
451451

452452
//Add segment to the proper layer, and color it
453-
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
453+
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
454454
layer.path = path.CGPath;
455455
layer.fillColor = [self colorForSegment:i].CGColor;
456456
}
@@ -529,7 +529,7 @@ - (void)drawIndeterminate
529529
}
530530

531531
//Add the segment to the proper path //Add segment to the proper layer, and color it
532-
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
532+
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
533533
layer.path = path.CGPath;
534534
if (i >= indeterminateIndex && i < indeterminateIndex + numberOfSegmentsToBeColored) {
535535
layer.fillColor = ((UIColor *)segmentColorsPrimary[i]).CGColor;

0 commit comments

Comments
 (0)