Skip to content

ExistentialContainer

tevelee edited this page Jul 21, 2026 · 1 revision

ExistentialContainer

An existential container is a type in Swift that contains some struct or class with information of what the type it's containing is, and the witness tables needed that the existential (protocol) is.

public struct ExistentialContainer 

ABI Stability: Stable since the following

| macOS | iOS/tvOS | watchOS | Linux | Windows |
|-------|----------|---------|-------|---------|
| 10.14 | 12.2     | 5.2     | NA    | NA      |

Initializers

init(base:witnessTable:)

Initializes an existential container with a base container and witness table.

public init(base: AnyExistentialContainer, witnessTable: WitnessTable) 

Parameters

  • base: The base any existential container holding the value and type metadata.
  • witnessTable: The witness table for the protocol conformance.

Properties

base

The base any existential, also known as Any.

public var base: AnyExistentialContainer

witnessTable

A pointer to the witness table.

public var witnessTable: WitnessTable
Types
Protocols
Global Typealiases
Global Variables
Global Functions

Clone this wiki locally