Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upload arrow #5

Open
muenzpraeger opened this issue Aug 21, 2013 · 2 comments
Open

Upload arrow #5

muenzpraeger opened this issue Aug 21, 2013 · 2 comments

Comments

@muenzpraeger
Copy link

Hi,

having an upload arrow would be a nice addition.

-- René

@seb-m
Copy link

seb-m commented Sep 26, 2013

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.

@yakubbaev
Copy link

+1

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants