UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.backgroundColor = [UIColor redColor];
button.frame = CGRectMake(0, 0, 100, 44);
CGRect bounds = button.bounds;
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:frame.size.width/2];
CAShapeLayer *shapeLayer = [CAShapeLayer layer];
shapeLayer.frame = bounds;
shapeLayer.path = path.CGPath;
button.layer.mask = shapeLayer;