iOS Developer Library

Developer

AddressBookUI Framework Reference ABNewPersonViewController Class Reference

Options
Deployment Target:

On This Page
Language:

ABNewPersonViewController

Inheritance


Import Statement


Swift

import AddressBookUI

Objective-C

@import AddressBookUI;

Availability


Available in iOS 2.0 and later.

The ABNewPersonViewController class (whose instances are known as new-person view controllers) implements the view controller used to create a contact.

New-person view controllers are modal view controllers that manage a set of view controllers used to create a contact (ABPersonRef) and edit its properties.

Subclassing Notes

The ABNewPersonViewController class does not support subclassing.

  • Optional. Specifies the person properties that the new-person view controller pre-fills in its views.

    Declaration

    Swift

    var displayedPerson: ABRecord!

    Objective-C

    @property(nonatomic, readwrite) ABRecordRef displayedPerson

    Discussion

    When this property has no person properties, the new-person view controller does not pre-fill properties in its views.

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

  • Optional. The address book to which the new contact is added.

    Declaration

    Swift

    var addressBook: ABAddressBook!

    Objective-C

    @property(nonatomic, readwrite) ABAddressBookRef addressBook

    Discussion

    When unset, an address book is created and assigned to this property when needed.

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

  • Optional. Specifies the group to which to add the new contact on save.

    Declaration

    Swift

    var parentGroup: ABRecord!

    Objective-C

    @property(nonatomic, readwrite) ABRecordRef parentGroup

    Discussion

    You must set addressBook before you can set this property.

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.

  • The delegate of a new-person view controller.

    Declaration

    Swift

    unowned(unsafe) var newPersonViewDelegate: ABNewPersonViewControllerDelegate!

    Objective-C

    @property(nonatomic, assign) id< ABNewPersonViewControllerDelegate > newPersonViewDelegate

    Discussion

    The delegate must adopt the ABNewPersonViewControllerDelegate formal protocol.

    Import Statement

    Objective-C

    @import AddressBookUI;

    Swift

    import AddressBookUI

    Availability

    Available in iOS 2.0 and later.