Was tricky for me, but I made it.
Here is what you need to make this: you need a UIView
(as a container for UIImageView
).
Change this part in source code that I posted below:
CALayer *mask = [CALayer layer];
mask.contents = (id)[[UIImage imageNamed:@"mask.png"] CGImage];
mask.frame = self.yourContainerView.bounds;
self.yourContainerView.layer.mask = mask;
self.yourContainerView.layer.masksToBounds = YES;
That's all. Hope this will help somebody.