An optional layer whose alpha channel is used to mask the layer’s content.
- iOS 3.0+
- macOS 10.5+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- Core Animation
The layer’s alpha channel determines how much of the layer’s content and background shows through. Fully or partially opaque pixels allow the underlying content to show through, but fully transparent pixels block that content.
The default value of this property is
nil. When configuring a mask, remember to set the size and position of the mask layer to ensure it is aligned properly with the layer it masks.
The layer you assign to this property must not have a superlayer. If it does, the behavior is undefined.