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).

See Also 参照

Working with Classes クラスを扱う