Type Method

attributedStringFromContact:style:defaultAttributes:

Formats the contact name as an attributed string.

Declaration

+ (NSAttributedString *)attributedStringFromContact:(CNContact *)contact style:(CNContactFormatterStyle)style defaultAttributes:(NSDictionary *)attributes;

Parameters

contact

The contact whose name is to be formatted.

style

The formatting style to be used for the contact name.

attributes

The default attributes to use. For more information, see NSFormatter.

Return Value

The formatted contact name as an attributed string.

Discussion

This method behaves similarly to stringFromContact:style:, except that it returns an attributed string. It includes the attribute key CNContactPropertyAttribute, whose attribute values are contact property keys, such as CNContactGivenNameKey. This identifies the name components in the formatted contact name.

See Also

Creating a Formatted Attributed String

- attributedStringFromContact:defaultAttributes:

Formats the contact name as an attributed string.