Function 関数

class_getClassMethod(_:_:)

Returns a pointer to the data structure describing a given class method for a given class. ある与えられたクラスに対するある与えられたメソッドを記述しているデータ構造体へのポインタを返します。

Declaration 宣言

func class_getClassMethod(_ cls: AnyClass?, 
                        _ name: Selector) -> Method?

Parameters パラメータ

aClass

A pointer to a class definition. Pass the class that contains the method you want to retrieve.

aSelector

A pointer of type SEL. Pass the selector of the method you want to retrieve.

Return Value 戻り値

A pointer to the Method data structure that corresponds to the implementation of the selector specified by aSelector for the class specified by aClass, or NULL if the specified class or its superclasses do not contain a class method with the specified selector.

Discussion 解説

Note that this function searches superclasses for implementations, whereas class_copyMethodList(_:_:) does not.

See Also 参照

Working with Classes クラスを扱う