//若单独使用失效(原因是获取不到真实的frame),使用dispatch_after延时0秒执行即可(gcd会在下一次runloop执行,获取真实frame)
-(void)hjy_addCorner:(CGFloat ) num
{
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(num, num)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.bounds;
maskLayer.path = maskPath.CGPath;
self.layer.mask = maskLayer;
}