UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,
0,
100,
100)];
imageView.center =
CGPointMake(200,
300);
UIImage *anotherImage = [UIImage imageNamed:@"image"];
UIGraphicsBeginImageContextWithOptions(imageView.bounds.size,
NO,
1.0);
[[UIBezierPath bezierPathWithRoundedRect:imageView.bounds
cornerRadius:50]
addClip];
[anotherImage drawInRect:imageView.bounds];
imageView.image =
UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.view
addSubview:imageView];