Function

class_addProtocol(_:_:)

Adds a protocol to a class.

Declaration

func class_addProtocol(_ cls: AnyClass!, _ protocol: Protocol!) -> Bool

Parameters

cls

The class to modify.

outCount

The protocol to add to cls.

Return Value

true if the protocol was added successfully, otherwise false (for example, the class already conforms to that protocol).