Text

public struct Text : Hashable
extension Text: Shortcut
extension Text: ConditionOperandConvertible
extension Text: ConditionTextOperandConvertible
extension Text: ExpressibleByStringInterpolation
extension Text: Encodable

A representation of one or more lines of text that can be used in shortcuts.

  • Creates a text shortcut that represents a stored string without variables.

    Declaration

    Swift

    public init(_ string: String)

    Parameters

    string

    The string value to store.

  • The contents of the shortcut.

    Declaration

    Swift

    public var body: some Shortcut { get }
  • An operand that represents this value.

    Declaration

    Swift

    public var conditionOperand: ConditionOperand { get }
  • A text operand that represents this value.

    Declaration

    Swift

    public var conditionTextOperand: ConditionTextOperand { get }
  • The string interpolation type used by Text that property encodes Variable values.

    See more

    Declaration

    Swift

    public struct StringInterpolation : StringInterpolationProtocol
  • Creates an instance initialized to the given string value.

    Attention

    Do not call this initializer directly. Instead, initialize a variable or constant using a string literal.

    Declaration

    Swift

    public init(stringLiteral value: String)

    Parameters

    value

    The value of the new instance.

  • Creates an instance from a string interpolation.

    Attention

    Do not call this initializer directly. Instead, initialize a variable or constant using an interpolated string literal.

    Declaration

    Swift

    public init(stringInterpolation: StringInterpolation)

    Parameters

    stringInterpolation

    An instance of StringInterpolation which has had each segment of the string literal appended to it.

  • 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.