One Logo Pool Ball
Foundation · IOS API REFERENCE

URL.Template.Value

struct · iOS 26.0+ · SDK 27.1

struct Value

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.

static · iOS 26.0+

text

TypeScript
static text(text: string): URL_Template_Value
Swift declaration
static func text(_ text: String) -> URL.Template.Value

A text value to be used with a ``URL.Template``.

Skipped declarations

4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

URL.Template.Value.list(_:)

This parameter hides a concrete Swift type.

URL.Template.Value.associativeList(_:)

This parameter hides a concrete Swift type.

URL.Template.Value.init(arrayLiteral:)

A variable number of Swift arguments is not supported.

URL.Template.Value.init(dictionaryLiteral:)

A variable number of Swift arguments is not supported.

All Foundation types →