One Logo Pool Ball
Foundation · IOS API REFERENCE

URL.FormatStyle.ComponentDisplayOption

struct · iOS 16.0+ · SDK 27.1

struct ComponentDisplayOption

Specifies the display option for a component, including whether to display or omit the component and the condition to do so.

Members (6)

get · iOS 16.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.

static · iOS 16.0+

displayWhen

TypeScript
static displayWhen(component: URL_FormatStyle_Component, requirements: Array<string>): URL_FormatStyle_ComponentDisplayOption
Swift declaration
static func displayWhen(_ component: URL.FormatStyle.Component, matches requirements: Set<String>) -> URL.FormatStyle.ComponentDisplayOption

Creates a display option to display the component if the given condition is met.

get · iOS 16.0+

omitIfHTTPFamily

TypeScript
static get omitIfHTTPFamily(): URL_FormatStyle_ComponentDisplayOption
Swift declaration
static var omitIfHTTPFamily: URL.FormatStyle.ComponentDisplayOption { get }

Creates a display option to omit the component if the URL's scheme is `http` or `https`.

get · iOS 16.0+

never

TypeScript
static get never(): URL_FormatStyle_ComponentDisplayOption
Swift declaration
static var never: URL.FormatStyle.ComponentDisplayOption { get }

Creates a display option to always omit the component.

get · iOS 16.0+

always

TypeScript
static get always(): URL_FormatStyle_ComponentDisplayOption
Swift declaration
static var always: URL.FormatStyle.ComponentDisplayOption { get }

Creates a display option to always display the component.

static · iOS 16.0+

omitWhen

TypeScript
static omitWhen(component: URL_FormatStyle_Component, requirements: Array<string>): URL_FormatStyle_ComponentDisplayOption
Swift declaration
static func omitWhen(_ component: URL.FormatStyle.Component, matches requirements: Set<String>) -> URL.FormatStyle.ComponentDisplayOption

Creates a display option to omit the component if the given condition is met.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →