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
stringThe 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 } -
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
valueThe 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
stringInterpolationAn instance of
StringInterpolationwhich 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) throwsParameters
encoderThe encoder to write data to.
View on GitHub
Text Structure Reference