iOS Developer Library

Developer

AddressBookUI Framework Reference Address Book UI Functions Reference

Options
Deployment Target:

On This Page
Language:

Address Book UI Functions Reference

Inherits From


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import AddressBookUI

Objective-C

@import AddressBookUI;

The Address Book UI functions provide functionality for formatting contact information.

Functions

  • Returns a formatted address from an address property.

    Declaration

    Swift

    func ABCreateStringWithAddressDictionary(_ address: [NSObject : AnyObject]!, _ addCountryName: Bool) -> String!

    Objective-C

    NSString * ABCreateStringWithAddressDictionary ( NSDictionary *address, BOOL addCountryName );

    Parameters

    address

    A dictionary representing the address property to format.

    addCountryName

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

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

    When YEStrue and address doesn’t include a country name, the country name is added to the return value. (The country 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 name (kABPersonAddressCountryKey).

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later