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
objc_getProtocol(_:)objc_copyProtocolList(_:)objc_registerProtocol(_:)protocol_addMethodDescription(_:_:_:_:_:)protocol_addProtocol(_:_:)protocol_addProperty(_:_:_:_:_:_:)protocol_getName(_:)protocol_isEqual(_:_:)protocol_copyMethodDescriptionList(_:_:_:_:)protocol_getMethodDescription(_:_:_:_:)protocol_copyPropertyList(_:_:)protocol_getProperty(_:_:_:_:)protocol_copyProtocolList(_:_:)protocol_conformsToProtocol(_:_:)