This is the background image

This is the logo

How can we make a image like this in Swift?

Update
Now I manage to use the logo as a mask and get something like this,

Is there any way to reverse the mask?
Here is my code
let logo = UIImage(named: "logo")!
let mask = CALayer()
mask.contents = logo.CGImage
mask.frame = mImageView.layer.bounds
mImageView.layer.mask = mask
				
                        
You can do it programmatically using UIBezierPath:
If you need to use an image and invert the alpha of you logo programmatically you can do as follow using kCGBlendModeDestinationOut: