The value of a variable used for expanding a template.
A value can either be some text, a list, or an associate list (a dictionary).
### Examples
```swift
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.
```swift
let hello: URL.Template.Value = "Hello World!"
let list: URL.Template.Value = ["red", "green", "blue"]
let keys: URL.Template.Value = [
"semi": ";",
"dot": ".",
"comma": ",",
]
```
Members (3)
get · iOS 26.0+
description
TypeScript
get description(): string
Swift declaration
var description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
init · iOS 26.0+
init
TypeScript
static init(value: string): URL_Template_Value
Swift declaration
init(stringLiteral value: String)
Creates an instance initialized to the given string value.
- Parameter value: The value of the new instance.