TimeSpanValue

public struct TimeSpanValue : Encodable

A time duration represented by a floating-point number and a time unit or variable.

  • A floating-point number represented as optional text. When nil, represents “anything” in the Shortcuts app.

    Declaration

    Swift

    public var number: Text?
  • A time unit or a variable like Variable.askEachTime.

    Declaration

    Swift

    public var unit: VariableValue<TimeUnit>
  • Declaration

    Swift

    public init(number: Text?, unit: VariableValue<TimeUnit>)

    Parameters

    number

    A floating-point number represented as optional text. When nil, represents “anything” in the Shortcuts app.

    unit

    A time unit or a variable like Variable.askEachTime.

  • Declaration

    Swift

    public init(number: Text?, unit: TimeUnit)

    Parameters

    number

    A floating-point number represented as optional text. When nil, represents “anything” in the Shortcuts app.

    unit

    A time unit.

  • Declaration

    Swift

    public init(number: Text?, unit: Variable)

    Parameters

    number

    A floating-point number represented as optional text. When nil, represents “anything” in the Shortcuts app.

    unit

    A variable like Variable.askEachTime.

  • Encodes this value into the given encoder.

    Throws

    This function throws an error if any values are invalid for the given encoder’s format.

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    The encoder to write data to.