StructureFoundationEssentials
URL.Template.Value
iOS 26.0+
iPadOS 26.0+
Mac Catalyst 26.0+
macOS 26.0+
tvOS 26.0+
visionOS 26.0+
watchOS 26.0+
The value of a variable used for expanding a template.
struct Value
Overview
A value can either be some text, a list, or an associate list (a dictionary).
Examples
let hello: URL.Template.Value = .text("Hello World!")
let list: URL.Template.Value = .list(["red", "green", "blue"])
let keys: URL.Template.Value = .associativeList([
"semi": ";",
"dot": ".",
"comma": ",",
])
Alternatively, for constants, the ExpressibleBy…Literal implementations can be used, i.e.
let hello: URL.Template.Value = "Hello World!"
let list: URL.Template.Value = ["red", "green", "blue"]
let keys: URL.Template.Value = [
"semi": ";",
"dot": ".",
"comma": ",",
]
Topics
Type Methods
static func associativeList(some Sequence<(key: String, value: String)>) -> URL.Template.ValueAn associative list value (ordered key-value pairs) to be used with aURL.Template.static func list(some Sequence<String>) -> URL.Template.ValueA list value (an array ofStrings) to be used with aURL.Template.static func text(String) -> URL.Template.ValueA text value to be used with aURL.Template.
Default Implementations
Relationships
Conforms To
Swift.CopyableSwift.CustomStringConvertibleSwift.EquatableSwift.EscapableSwift.ExpressibleByArrayLiteralSwift.ExpressibleByDictionaryLiteralSwift.ExpressibleByExtendedGraphemeClusterLiteralSwift.ExpressibleByStringLiteralSwift.ExpressibleByUnicodeScalarLiteralSwift.HashableSwift.SendableSwift.SendableMetatype