+ (void)maskToCorner:(UIView *)view cornerRedius:(CGFloat )layer {
CGSize size = CGSizeMake(layer, layer);
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:view.bounds
byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight|UIRectCornerBottomLeft|UIRectCornerBottomRight
cornerRadii:size];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];
maskLayer.frame = view.bounds;
maskLayer.path = maskPath.CGPath;
view.layer.mask = maskLayer;
}