Skip to content

swift_conformsToProtocol(metadata_protocol_)

tevelee edited this page Jul 21, 2026 · 1 revision

swift_conformsToProtocol(metadata:protocol:)

Checks whether the type conforms to the given protocol.

public func swift_conformsToProtocol(
  metadata: Metadata,
  protocol: ProtocolDescriptor
) -> WitnessTable? 

Parameters

  • metadata: Type metadata to check conformance of.
  • protocol: The protocol to check to see if the type conforms to.

Returns

A witness table of the conformance if it does conform, or nil if it doesn't conform.

Types
Protocols
Global Typealiases
Global Variables
Global Functions

Clone this wiki locally