Skip to content

swift_conformsToProtocol(type_protocol_)

tevelee edited this page Jul 21, 2026 · 1 revision

swift_conformsToProtocol(type:protocol:)

Checks whether the type conforms to the given protocol.

public func swift_conformsToProtocol(
  type: Any.Type,
  protocol: ProtocolDescriptor
) -> WitnessTable? 

Parameters

  • type: Type 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