Contents

protocol_conformsToProtocol(_:_:)

Returns a Boolean value that indicates whether one protocol conforms to another protocol.

Declaration

func protocol_conformsToProtocol(_ proto: Protocol?, _ other: Protocol?) -> Bool

Parameters

  • proto:

    A protocol.

  • other:

    A protocol.

Return Value

YES if proto conforms to other, otherwise NO.

Discussion

One protocol can incorporate other protocols using the same syntax that classes use to adopt a protocol:

@protocol ProtocolName < protocol list >

All the protocols listed between angle brackets are considered part of the ProtocolName protocol.

See Also

Working with Protocols