FFCircularProgressView icon indicating copy to clipboard operation
FFCircularProgressView copied to clipboard

Upload arrow

Open muenzpraeger opened this issue 11 years ago • 2 comments

Hi,

having an upload arrow would be a nice addition.

-- René

muenzpraeger avatar Aug 21 '13 13:08 muenzpraeger

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.

seb-m avatar Sep 26 '13 12:09 seb-m

+1

yakubbaev avatar Feb 11 '14 15:02 yakubbaev