Thanks drawnonward,
ended up with this function:
- (UIImage*) maskImage:(UIView *)image withMask:(UIImage *)maskImage {
UIGraphicsBeginImageContext(image.bounds.size);
[image.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGImageRef maskRef = maskImage.CGImage;
CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef),
CGImageGetHeight(maskRef),
CGImageGetBitsPerComponent(maskRef),
CGImageGetBitsPerPixel(maskRef),
CGImageGetBytesPerRow(maskRef),
CGImageGetDataProvider(maskRef), NULL, false);
CGImageRef masked = CGImageCreateWithMask([viewImage CGImage], mask);
return [UIImage imageWithCGImage:masked];
}