AddressSubregions

The subregions (states / provinces / territories) the Frame API accepts for a country. Mirrors iOS AddressSubregions.

Properties

Link copied to clipboard

The subregions accepted for Canadian addresses — 10 provinces and 3 territories.

Link copied to clipboard

The subregions accepted for United States addresses.

Functions

Link copied to clipboard
fun codes(forCountry: String): Set<String>?

Returns the accepted subregion codes for a country, or null when the country is unvalidated.

Link copied to clipboard
fun normalize(value: String, countryCode: String): String

Trims a subregion, upcasing it only for countries whose subregions are validated as codes.

Link copied to clipboard
fun subregion(forCode: String, countryCode: String): AddressSubregion?

Looks up a subregion by its code within a country's list.

Link copied to clipboard

Returns the subregions for a country, or null when its subregion is unvalidated free text.