1. Quartz2D
UIImage *oldImage = [UIImageimageNamed:@"me"];
UIGraphicsBeginImageContextWithOptions(oldImage.size,NO, 0.0);
CGContextRef ctx =UIGraphicsGetCurrentContext();
CGContextAddEllipseInRect(ctx, CGRectMake(0, 0, oldImage.size.width, oldImage.size.height));
CGContextClip(ctx);
[oldImagedrawInRect:CGRectMake(0,0, oldImage.size.width, oldImage.size.height)];
self.iconView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
2.CALayer (圆角裁剪)
self.iconView.layer.cornerRadius =10;
self.iconView.layer.masksToBounds = YES;