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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software