PortableAddress
protocol PortableAddress
A protocol that defines the properties of a portable address.
A portable address contains general fields such as administrative areas.
Depending on the country, each fields may represent a different thing. For instance:
adminArea1
corresponds to state
in the US, while it means county
in GB.
In order to support address globally, portable addresses are preferred, as we move on to deprecate
the older coarse format (where there were specific fixed properties like state
and city
).
-
Line 1 of shipping address (usually for street address)
Declaration
Swift
var addressLine1: String? { get }
-
Line 2 of shipping address (usually for apartment number)
Declaration
Swift
var addressLine2: String? { get }
-
Line 3 of shipping address (extra line for address which is required for some countries)
Declaration
Swift
var addressLine3: String? { get }
-
Admin area 1 (ie. State for US, and County for GB)
Declaration
Swift
var adminArea1: String? { get }
-
Admin area 2 (ie. City for US, and Town/City for GB)
Declaration
Swift
var adminArea2: String? { get }
-
Admin area 3 (extra area which is required for some countries, ie. District/County for CN)
Declaration
Swift
var adminArea3: String? { get }
-
Admin area 4 (extra area which is required for some countries, ie. Neighborhood for CN)
Declaration
Swift
var adminArea4: String? { get }
-
Country code (ie. US, GB, CN, etc.)
Declaration
Swift
var countryCode: String? { get }
-
Postal or zip code
Declaration
Swift
var postalCode: String? { get }