Contents

ABCreateStringWithAddressDictionary(_:_:)

Returns a formatted address from an address property.

Declaration

func ABCreateStringWithAddressDictionary(_ address: [AnyHashable : Any], _ addCountryName: Bool) -> String

Parameters

  • address:

    A dictionary representing the address property to format.

  • addCountryName:

    Specifies whether to include the name of the country or region in the returned formatted address.

    When False and address includes a country or region name, that country or region name is still included in the return value.

    When True and address doesn’t include a country or region name, the country or region name is added to the return value. (The country or region name is generated from the country code entry in address; see Address Property.)

Return Value

The formatted address (may include line endings).

Discussion

The address is formatted based on the address’s country code (kABPersonAddressCountryCodeKey). In general, the country code should be set to correspond with the country or region name (kABPersonAddressCountryKey).

See Also

Detail Display