Contents

trimDuration

An optional duration that overrides the source animation’s duration.

Declaration

var trimDuration: TimeInterval? { get set }

Discussion

The framework calculates duration, but you can set this property to override it. This property is nil by default, which indicates that the animation stops after one play that spans duration.

If you set a non-zero value for this property and both trimStart and trimEnd are nil, the animation observes this property as an edited duration.

When you set repeatMode to make the animation repeat:

  • If this property is nil, the animation repeats forever.

  • If set to a value greater than duration, the animation repeats for the specified duration.

See Also

Timing the animation