Contents

objc_allocateProtocol(_:)

Creates a new protocol instance.

Declaration

func objc_allocateProtocol(_ name: UnsafePointer<CChar>) -> Protocol?

Parameters

  • name:

    The name of the protocol you want to create.

Return Value

A new protocol instance or nil if a protocol with the same name as name already exists.

Discussion

You must register the returned protocol instance with the objc_registerProtocol(_:) function before you can use it.

There is no dispose method associated with this function.

See Also

Working with Protocols