iOS Developer Library — Pre-Release

Developer

AddressBookUI Framework Reference ABUnknownPersonViewController Class Reference

Options
Deployment Target:

On This Page
Language:

ABUnknownPersonViewController

Inheritance


Conforms To


Import Statement


Swift

import AddressBookUI

Objective-C

@import AddressBookUI;

Availability


Available in iOS 2.0 and later.

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 *alternateName

    Discussion

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

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

  • message message Property

    Text displayed below alternateName.

    Declaration

    Swift

    var message: String!

    Objective-C

    @property(nonatomic, copy) NSString *message

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    var displayedPerson: ABRecord!

    Objective-C

    @property(nonatomic, readwrite) ABRecordRef displayedPerson

    Discussion

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

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

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

    Declaration

    Swift

    var addressBook: ABAddressBook!

    Objective-C

    @property(nonatomic, readwrite) ABAddressBookRef 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.

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

  • 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.

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

  • 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.

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

  • The unknown-person view controller delegate.

    Declaration

    Swift

    unowned(unsafe) var unknownPersonViewDelegate: ABUnknownPersonViewControllerDelegate!

    Objective-C

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

    Discussion

    The delegate must adopt the ABUnknownPersonViewControllerDelegate protocol.

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.