setAlpha(_:)
Sets the opacity of the interface object.
Declaration
func setAlpha(_ alpha: CGFloat)Parameters
- alpha:
A floating-point number in the range
0.0to1.0, where0.0represents totally transparent and1.0represents totally opaque.
Discussion
Use this property to make an object fully or partially transparent. A partially transparent object allows the color or background image associated with the containing group or interface controller show through. A fully transparent object cannot be seen but continues to occupy space in your interface.
Changes to the alpha value of an object are animatable.