Skip to content

Instantly share code, notes, and snippets.

@joaoBeno
Created November 11, 2015 02:33
Show Gist options
  • Save joaoBeno/46261c5802b2a007f776 to your computer and use it in GitHub Desktop.
Save joaoBeno/46261c5802b2a007f776 to your computer and use it in GitHub Desktop.
Setar bordas customizadas no botão...
UIBezierPath *shapePathFB = [UIBezierPath bezierPathWithRoundedRect:self.btnSampleOutlet.bounds
byRoundingCorners:UIRectCornerTopRight | UIRectCornerBottomRight
cornerRadii:CGSizeMake(7.0, 7.0)];
CAShapeLayer *shapeLayerFB = [CAShapeLayer layer];
shapeLayerFB.frame = self.btnSampleOutlet.bounds; // Why set bounds? My btn has bounds already...
shapeLayerFB.path = shapePathFB.CGPath;
shapeLayerFB.fillColor = [UIColor clearColor].CGColor;
shapeLayerFB.strokeColor = [UIColor blackColor].CGColor;
shapeLayerFB.lineWidth = 1;
[self.btnSampleOutlet.layer addSublayer:shapeLayerFB];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment