Function

protocol_copyMethodDescriptionList(_:_:_:_:)

Returns an array of method descriptions of methods meeting a given specification for a given protocol.

Declaration

func protocol_copyMethodDescriptionList(_ proto: Protocol, _ isRequiredMethod: Bool, _ isInstanceMethod: Bool, _ outCount: UnsafeMutablePointer<UInt32>?) -> UnsafeMutablePointer<objc_method_description>?

Parameters

p

A protocol.

isRequiredMethod

A Boolean value that indicates whether returned methods should be required methods (pass true to specify required methods).

isInstanceMethod

A Boolean value that indicates whether returned methods should be instance methods (pass true to specify instance methods).

outCount

Upon return, contains the number of method description structures in the returned array.

Return Value

A C array of objc_method_description structures containing the names and types of p’s methods specified by isRequiredMethod and isInstanceMethod. The array contains *outCount pointers followed by a NULL terminator. You must free the list with free().

If the protocol declares no methods that meet the specification, NULL is returned and *outCount is 0.

Discussion

Methods in other protocols adopted by this protocol are not included.

See Also

Working with Protocols

func objc_registerProtocol(Protocol)

Registers a newly created protocol with the Objective-C runtime.

func protocol_addProtocol(Protocol, Protocol)

Adds a registered protocol to another protocol that is under construction.

func protocol_isEqual(Protocol?, Protocol?) -> Bool

Returns a Boolean value that indicates whether two protocols are equal.

func protocol_getMethodDescription(Protocol, Selector, Bool, Bool) -> objc_method_description

Returns a method description structure for a specified method of a given protocol.

func protocol_conformsToProtocol(Protocol?, Protocol?) -> Bool

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software