iOS Developer Library — Prerelease

Developer

Address Book UI Framework Reference for iOS ABUnknownPersonViewController Class Reference

Options
Deployment Target:

On This Page
Language:

ABUnknownPersonViewController

The ABUnknownPersonViewController class (whose instances are known as unknown-person view controllers) implements a view controller used to create a person record from a set of person properties.

Unknown-person view controllers display contact information that can be saved to the Address Book database. From instances of this class, users may also initiate standard actions, such as:

  • Phone call

  • Text message

  • Create contact

  • Add to contact

Performing any of the standard actions may result in your application being moved to the background.

Subclassing Notes

The ABUnknownPersonViewController class does not support subclassing.

  • Provides a value that is displayed instead of the first and last name.

    Declaration

    Swift

    var alternateName: String?

    Objective-C

    @property(nonatomic, copy) NSString * _Nullable alternateName

    Discussion

    The alternate name is only for display. It is not saved if this contact is added to the address book database.

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • message message (iOS 9.0) Property

    Text displayed below alternateName.

    Declaration

    Swift

    var message: String?

    Objective-C

    @property(nonatomic, copy) NSString * _Nullable message

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • Specifies a person record whose properties are displayed by the view controller.

    Declaration

    Swift

    var displayedPerson: ABRecord

    Objective-C

    @property(nonatomic, readwrite) ABRecordRef _Nonnull displayedPerson

    Discussion

    All the properties of displayedPerson are displayed by the view controller.

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • addressBook addressBook (iOS 9.0) Property

    Optional. The address book database that the person record is added to.

    Declaration

    Swift

    var addressBook: ABAddressBook?

    Objective-C

    @property(nonatomic, readwrite) ABAddressBookRef _Nullable addressBook

    Discussion

    When unspecified, this view controller sets the value of this property by creating an ABAddressBookRef object.

    The person record is only added to the address book database if allowsAddingToAddressBook is YEStrue and the user taps the “Add to Existing Contact” or “Create New Contact” button.

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • Specifies whether buttons appear to let the user perform actions such as sharing the contact, initiating a FaceTime call, or sending a text message.

    Declaration

    Swift

    var allowsActions: Bool

    Objective-C

    @property(nonatomic) BOOL allowsActions

    Discussion

    The default value is NOfalse.

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • Specifies whether the user can add the properties displayed by the unknown-person view controller to the address book database, either as a new contact or by adding them to an existing contact.

    Declaration

    Swift

    var allowsAddingToAddressBook: Bool

    Objective-C

    @property(nonatomic) BOOL allowsAddingToAddressBook

    Discussion

    The default value is NOfalse.

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.

  • The unknown-person view controller delegate.

    Declaration

    Swift

    unowned(unsafe) var unknownPersonViewDelegate: ABUnknownPersonViewControllerDelegate?

    Objective-C

    @property(nonatomic, assign) id< ABUnknownPersonViewControllerDelegate > _Nullable unknownPersonViewDelegate

    Discussion

    The delegate must adopt the ABUnknownPersonViewControllerDelegate protocol.

    Availability

    Available in iOS 2.0 and later.

    Deprecated in iOS 9.0.