Function 関数

objc_getMetaClass(_:)

Returns the metaclass definition of a specified class.

Declaration 宣言

func objc_getMetaClass(_ name: UnsafePointer<CChar>) -> Any!

Parameters パラメータ

name

The name of the class to look up.

Return Value 戻り値

The Class object for the metaclass of the named class, or nil if the class is not registered with the Objective-C runtime.

Discussion 解説

If the definition for the named class is not registered, this function calls the class handler callback and then checks a second time to see if the class is registered. However, every class definition must have a valid metaclass definition, and so the metaclass definition is always returned, whether it’s valid or not.

See Also 参照

Obtaining Class Definitions