Instance Method

object(forKey:)

Returns the value of the component corresponding to the specified key.

Declaration

func object(forKey key: NSLocale.Key) -> Any?

Parameters

key

The component for which to return the corresponding value. For possible values, see NSLocale.Key.

Return Value

The object corresponding to key.

See Also

Accessing Locale Information by Key

func displayName(forKey: NSLocale.Key, value: Any) -> String?

Returns the display name for the given locale component value.

struct NSLocale.Key

The keys used to access components of a locale.