I am working on a photo collage iphone app and i have to make irregular shape photo frames inside each shape there will be a uiimageview with gestures, on tapping the shape i need to pick a photo for that shape, these frames are very similar to frames of instacollage iphone app. link : https://itunes.apple.com/in/app/instacollage-pro-pic-frame/id530957474?mt=8
provide me some kind of direction how to do this task.
Thanks
You can use Mask property of the layer to achieve this.
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = self.imageView.bounds ;
UIBezierPath *roundedPath = [UIBezierPath bezierPathWithOvalInRect:maskLayer.frame];
maskLayer.fillColor = [[UIColor whiteColor] CGColor];
maskLayer.backgroundColor = [[UIColor clearColor] CGColor];
maskLayer.path = [roundedPath CGPath];
// Add mask
self.imageView.layer.mask = maskLayer;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With