Use Layer Mask to make parts of the UIView transparent?
问题 I have a UIViewController with a background color red of its self.view . I want to place a UIImageView in the center of the screen. The UIImageView show cover the entire screen and its background color should be blue. There should be a 100 x 100 image in the center when acts as mask. The image is a png with transparent and non transparent parts. Using this image as mask the background should be visible through the non transparent parts of this png. It should look like this: Here is a demo how