The country code for the locale.
SDKs
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
- watchOS 3.0+
Framework
- Foundation
Declaration
var countryCode: String? { get }
Discussion
Examples of country codes include "GB"
, "FR"
, and "HK"
.
Use localized
to obtain a version of the value suitable for display to the user.
This property contains the same value returned by the object(for
method when passing the country
key.