Function 関数

object_getIvar(_:_:)

Reads the value of an instance variable in an object. あるオブジェクトの中のあるインスタンス変数の値を読み出します。

Declaration 宣言

func object_getIvar(_ obj: Any?, 
                  _ ivar: Ivar) -> Any?

Parameters パラメータ

object

The object containing the instance variable whose value you want to read.

ivar

The Ivar describing the instance variable whose value you want to read.

Return Value 戻り値

The value of the instance variable specified by ivar, or nil if object is nil.

Discussion 解説

object_getIvar(_:_:) is faster than object_getInstanceVariable if the Ivar for the instance variable is already known.

See Also 参照

Working with Instances インスタンスを扱う