setOpacity(_:at:)
Sets the opacity value at a specific time within the time range of the instruction.
Declaration
func setOpacity(_ opacity: Float, at time: CMTime)Parameters
- opacity:
The opacity to be applied at
time. The value must be between0.0and1.0. - time:
A time value within the time range of the composition instruction.
Discussion
Sets a fixed opacity to apply from the specified time until the next time at which an opacity is set; this is the same as setting a flat ramp for that time range. Before the first time for which an opacity is set, the opacity is held constant at 1.0; after the last specified time, the opacity is held constant at the last value.