BTPostalAddress
@objcMembers
public class BTPostalAddress : NSObject, Encodable
Generic postal address
-
Recipient name for shipping address
Declaration
Swift
public let recipientName: String? -
Line 1 of the Address (e.g. number, street, etc)
Declaration
Swift
public let streetAddress: String? -
Line 2 of the Address (e.g. suite, apt #, etc.)
Declaration
Swift
public let extendedAddress: String? -
City name
Declaration
Swift
public let locality: String? -
2 letter country code
Declaration
Swift
public let countryCodeAlpha2: String? -
Zip code or equivalent
Declaration
Swift
public let postalCode: String? -
Either a two-letter state code (for the US), or an ISO-3166-2 country subdivision code of up to three letters
Declaration
Swift
public let region: String?
-
Creats a postal address with all components
Declaration
Swift
public init( recipientName: String? = nil, streetAddress: String? = nil, extendedAddress: String? = nil, locality: String? = nil, countryCodeAlpha2: String? = nil, postalCode: String? = nil, region: String? = nil )Parameters
recipientNameOptional. Recipient name for shipping address.
streetAddressOptional. Line 1 of the Address (eg. number, street, etc).
extendedAddressOptional. Line 2 of the Address (eg. suite, apt #, etc.).
localityOptional. City name
countryCodeAlpha2Optional. 2 letter country code.
postalCodeOptional. Zip code or equivalent is usually required for countries that have them. For a list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code.
regionOptional. Either a two-letter state code (for the US), or an ISO-3166-2 country subdivision code of up to three letters.
-
Returns address components as a dictionary for accessing internal properties across modules
Declaration
Swift
public func addressComponents() -> [String : String]
View on GitHub