Address

public struct Address : Codable, Hashable

Address separated by the components

  • House number of the individual residential or business addresses.

    Declaration

    Swift

    public var houseNumber: String?
  • Street name of the individual residential or business addresses.

    Declaration

    Swift

    public var street: String?
  • Colloquial sub-city features often referred to in local parlance. Unlike locality features, these typically lack official status and may lack universally agreed-upon boundaries.

    Declaration

    Swift

    public var neighborhood: String?
  • Official sub-city features present in countries where such an additional administrative layer is used in postal addressing, or where such features are commonly referred to in local parlance. Examples include city districts in Brazil and Chile and arrondissements in France.

    Declaration

    Swift

    public var locality: String?
  • Postal codes used in country-specific national addressing systems.

    Declaration

    Swift

    public var postcode: String?
  • Typically these are cities, villages, municipalities, etc. They’re usually features used in postal addressing, and are suitable for display in ambient end-user applications where current-location context is needed (for example, in weather displays).

    Declaration

    Swift

    public var place: String?
  • Features that are smaller than top-level administrative features but typically larger than cities, in countries that use such an additional layer in postal addressing (for example, prefectures in China).

    Declaration

    Swift

    public var district: String?
  • Top-level sub-national administrative features, such as states in the United States or provinces in Canada or China.

    Declaration

    Swift

    public var region: String?
  • Generally recognized countries or, in some cases like Hong Kong, an area of quasi-national administrative status that has been given a designated country code under ISO 3166-1.

    Declaration

    Swift

    public var country: String?
  • The postal address associated with the location, formatted for use with the Contacts framework.

    Declaration

    Swift

    public var postalAddress: CNPostalAddress { get }
  • Address format style manage address string representation

    See more

    Declaration

    Swift

    public enum AddressFormatStyle
  • Build address string in requested style. All empty components will be skipped. Separator “, ” would be used to join all the components. House number will separated with “ ” separator For example, for .short style: “50 Beale St, 9th Floor” and for .medium – “50 Beale St, 9th Floor, San Francisco, California”

    Declaration

    Swift

    public func formattedAddress(style: AddressFormatStyle) -> String?

    Parameters

    style

    address style to be used

    Return Value

    Address string