FFCircularProgressView
FFCircularProgressView copied to clipboard
Upload arrow
Hi,
having an upload arrow would be a nice addition.
-- René
I had a similar need and just added this method:
- (void) drawArrowUp {
CGFloat radius = (self.bounds.size.width)/2;
CGFloat ratio = kArrowSizeRatio;
CGFloat segmentSize = self.bounds.size.width * ratio;
// Draw icon
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(0.0, segmentSize * 3.3)];
[path addLineToPoint:CGPointMake(segmentSize * 2.0, segmentSize * 3.3)];
[path addLineToPoint:CGPointMake(segmentSize * 2.0, segmentSize * 2.3)];
[path addLineToPoint:CGPointMake(segmentSize * 3.0, segmentSize * 2.3)];
[path addLineToPoint:CGPointMake(segmentSize, 0)];
[path addLineToPoint:CGPointMake(-segmentSize, segmentSize * 2.3)];
[path addLineToPoint:CGPointMake(0.0, segmentSize * 2.3)];
[path addLineToPoint:CGPointMake(0.0, segmentSize * 3.3)];
[path closePath];
[path applyTransform:CGAffineTransformMakeTranslation(-segmentSize /2.0, -segmentSize / 0.9)];
[path applyTransform:CGAffineTransformMakeTranslation(radius * (1-ratio), radius * (1-ratio))];
_iconLayer.path = path.CGPath;
_iconLayer.fillColor = nil;
}
I've also renamed the current method named drawArrow
to drawArrowDown
and added a new property to this class to select between these two arrows. It works fine for me.
+1