iOS - 圆角处理(忘了抠1)

@implementation UIView (IEExtention)

-(void)filletWithSize:(CGSize)size Radius:(CGFloat)radius corner:(UIRectCorner)corner{
        CGRect rect = self.bounds;
        rect.size = size;
        UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:corner cornerRadii:CGSizeMake(radius, radius)];
        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
        maskLayer.frame = rect;
        maskLayer.path = path.CGPath;
        self.layer.mask = maskLayer;
}
@end

你可能感兴趣的:(iOS - 圆角处理(忘了抠1))