DictionaryValue
public enum DictionaryValue
extension DictionaryValue: Encodable
extension DictionaryValue: ExpressibleByArrayLiteral
extension DictionaryValue: ExpressibleByBooleanLiteral
extension DictionaryValue: ExpressibleByDictionaryLiteral
extension DictionaryValue: ExpressibleByIntegerLiteral
extension DictionaryValue: ExpressibleByFloatLiteral
extension DictionaryValue: ExpressibleByStringLiteral
extension DictionaryValue: ExpressibleByStringInterpolation
A value that can be stored in a dictionary in the Shortcuts app.
-
A string value.
Declaration
Swift
case string(Text) -
A numeric value, stored as Text.
Declaration
Swift
case number(Text) -
A Boolean value or a variable representing one.
Declaration
Swift
case boolean(VariableValue<Bool>) -
A dictionary of other values.
Declaration
Swift
case dictionary([(key: Text, value: DictionaryValue)]) -
An array of other dictionary values.
Declaration
Swift
case array([DictionaryValue])
-
This convenience constructor converts the
Boolinto a variable value.Declaration
Swift
public static func boolean(_ value: Bool) -> DictionaryValueParameters
valueA Boolean value.
Return Value
A Boolean dictionary value.
-
This convenience constructor converts the ordered KeyValuePairs collection into an Array of tuples.
Declaration
Swift
public static func dictionary(_ value: KeyValuePairs<Text, DictionaryValue>) -> DictionaryValueParameters
valueA dictionary literal.
Return Value
A dictionary value.
-
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.
-
Creates an instance initialized with the given elements.
Declaration
Swift
public init(arrayLiteral elements: DictionaryValue...)Parameters
valueThe value of the new instance.
-
Creates an instance initialized to the given Boolean value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using one of the Boolean literals
trueandfalse.Declaration
Swift
public init(booleanLiteral value: Bool)Parameters
valueThe value of the new instance.
-
Creates an instance initialized with the given key-value pairs.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using a dictionary literal.
Declaration
Swift
public init(dictionaryLiteral elements: (Text, DictionaryValue)...)Parameters
valueThe value of the new instance.
-
Creates an instance initialized to the specified integer value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using an integer literal.
Declaration
Swift
public init(integerLiteral value: Int)Parameters
valueThe value of the new instance.
-
Creates an instance initialized to the specified floating-point value.
Attention
Do not call this initializer directly. Instead, initialize a variable or constant using a floating-point literal.
Declaration
Swift
public init(floatLiteral value: Double)Parameters
valueThe value of the new instance.
-
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: Text.StringInterpolation)Parameters
stringInterpolationAn instance of
StringInterpolationwhich has had each segment of the string literal appended to it.
View on GitHub
DictionaryValue Enumeration Reference