Skip to content

swift_conformsToProtocol(type:protocol:)

Azoy edited this page May 6, 2021 · 2 revisions

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 Variables
Global Functions
Clone this wiki locally