Contents

value(forKey:)

Returns the value associated with a given key.

Declaration

func value(forKey key: String) -> Any?

Parameters

  • key:

    The key for which to return the corresponding value. Note that when using key-value coding, the key must be a string (see 20002170).

Return Value

The value associated with key.

Discussion

If key does not start with “@”, invokes object(forKey:). If key does start with “@”, strips the “@” and invokes [super valueForKey:] with the rest of the key.

See Also

Related Documentation

Accessing Keys and Values