Mac Developer Library

Developer

AddressBook Framework Reference ABPeoplePickerView Class Reference

Options
Deployment Target:

On This Page
Language:

ABPeoplePickerView

The ABPeoplePickerView class allows you to customize the behavior of people-picker views in an application’s user interface.

Inheritance


Import Statement


Swift

import AddressBook

Objective-C

@import AddressBook;

Availability


Available in OS X v10.3 and later
  • Adds a property to the group of properties whose values are shown in the record list.

    Declaration

    Swift

    func addProperty(_ property: String!)

    Objective-C

    - (void)addProperty:(NSString *)property

    Parameters

    property

    The property to add.

    Discussion

    For additional information about properties see Constants.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Returns the title of a custom property.

    Declaration

    Swift

    func columnTitleForProperty(_ property: String!) -> String!

    Objective-C

    - (NSString *)columnTitleForProperty:(NSString *)property

    Parameters

    property

    The property whose title will be returned.

    Return Value

    The title of the custom property.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • The property currently displayed in the record list.

    Declaration

    Swift

    var displayedProperty: String!

    Objective-C

    @property(nonatomic, retain) NSString *displayedProperty

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Returns an array of the properties whose values are shown in the record list.

    Declaration

    Swift

    func properties() -> [AnyObject]!

    Objective-C

    - (NSArray *)properties

    Discussion

    For additional information about properties see Using Property Lists.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Removes a property from the group of properties whose values are shown in the record list.

    Declaration

    Swift

    func removeProperty(_ property: String!)

    Objective-C

    - (void)removeProperty:(NSString *)property

    Parameters

    property

    The property to remove.

    Discussion

    For additional information about properties see Using Property Lists.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Sets the title displayed in the people picker for a property.

    Declaration

    Swift

    func setColumnTitle(_ title: String!, forProperty property: String!)

    Objective-C

    - (void)setColumnTitle:(NSString *)title forProperty:(NSString *)property

    Parameters

    title

    The title to be set.

    property

    The property being titled.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • A Boolean value that specifies whether the user can select entire groups in the group column.

    Declaration

    Swift

    var allowsGroupSelection: Bool

    Objective-C

    @property(nonatomic, assign) BOOL allowsGroupSelection

    Discussion

    If YEStrue, the user can to select entire groups. If NOfalse, the user is required to select at least one person in the group.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • A Boolean value that specifies whether multiple groups, records, or values of multivalue properties can be selected at a time.

    Declaration

    Swift

    var allowsMultipleSelection: Bool

    Objective-C

    @property(nonatomic, assign) BOOL allowsMultipleSelection

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Deselects all selected groups, records, and values in multivalue properties.

    Declaration

    Swift

    func deselectAll(_ sender: AnyObject!)

    Objective-C

    - (void)deselectAll:(id)sender

    Parameters

    sender

    The object sending this message.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Deselects a group selected in the group list.

    Declaration

    Swift

    func deselectGroup(_ group: ABGroup!)

    Objective-C

    - (void)deselectGroup:(ABGroup *)group

    Parameters

    group

    The group to deselect.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Deselects a value selected in a multivalue property.

    Declaration

    Swift

    func deselectIdentifier(_ identifier: String!, forPerson person: ABPerson!)

    Objective-C

    - (void)deselectIdentifier:(NSString *)identifier forPerson:(ABPerson *)person

    Parameters

    identifier

    The identifier of the value that will be deselected.

    person

    The person whose value will be deselected.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Deselects a record selected in the record list.

    Declaration

    Swift

    func deselectRecord(_ record: ABRecord!)

    Objective-C

    - (void)deselectRecord:(ABRecord *)record

    Parameters

    record

    The record to deselect.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • The groups selected in the group list. (read-only)

    Declaration

    Swift

    var selectedGroups: [AnyObject]! { get }

    Objective-C

    @property(readonly) NSArray *selectedGroups

    Discussion

    The selected groups are returned as an array of ABGroup objects.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Returns the identifiers of the selected values in a multivalue property.

    Declaration

    Swift

    func selectedIdentifiersForPerson(_ person: ABPerson!) -> [AnyObject]!

    Objective-C

    - (NSArray *)selectedIdentifiersForPerson:(ABPerson *)person

    Parameters

    person

    The person whose identifiers for selected values will be returned.

    Discussion

    Returns nil if the property displayed is a single-value property, or if the selected value is not a property of person.

    The selectedRecords property returns all of the person records that were unified to display the selected records, which can require some extra care in passing the correct person record.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • The selection in the records list. (read-only)

    Declaration

    Swift

    var selectedRecords: [AnyObject]! { get }

    Objective-C

    @property(readonly) NSArray *selectedRecords

    Discussion

    The selection is returned as an array of ABGroup or ABPerson objects.

    Person records are unified by the people picker for display—multiple person records that represent the same person are displayed as if there were a single record containing all of the properties. If the user selects such a record, this array includes all of the person records that were unified.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Returns an array of all the values selected in the displayed multivalue property.

    Declaration

    Swift

    func selectedValues() -> [AnyObject]!

    Objective-C

    - (NSArray *)selectedValues

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Selects a group or a set of groups in the group list.

    Declaration

    Swift

    func selectGroup(_ group: ABGroup!, byExtendingSelection extend: Bool)

    Objective-C

    - (void)selectGroup:(ABGroup *)group byExtendingSelection:(BOOL)extend

    Parameters

    group

    The group to be selected, or to be added to the current selection.

    extend

    YEStrue to extend the current selection; otherwise, NOfalse.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Selects a value or a set of values in a multivalue property.

    Declaration

    Swift

    func selectIdentifier(_ identifier: String!, forPerson person: ABPerson!, byExtendingSelection extend: Bool)

    Objective-C

    - (void)selectIdentifier:(NSString *)identifier forPerson:(ABPerson *)person byExtendingSelection:(BOOL)extend

    Parameters

    identifier

    The identifier to be selected, or to be added to the current selection.

    person

    The person that the value to be selected is associated with.

    extend

    YEStrue to extend the current selection; otherwise, NOfalse.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Selects a record or a set of records in the record list.

    Declaration

    Swift

    func selectRecord(_ record: ABRecord!, byExtendingSelection extend: Bool)

    Objective-C

    - (void)selectRecord:(ABRecord *)record byExtendingSelection:(BOOL)extend

    Parameters

    record

    The record to be selected, or to be added to the current selection.

    extend

    YEStrue to extend the current selection; otherwise, NOfalse.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • The view that is placed to the left of the search field.

    Declaration

    Swift

    var accessoryView: NSView!

    Objective-C

    @property(nonatomic, retain) NSView *accessoryView

    Discussion

    If accessory is nil, the accessory view is removed.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Clears the search field and resets the list of displayed records.

    Declaration

    Swift

    func clearSearchField(_ sender: AnyObject!)

    Objective-C

    - (void)clearSearchField:(id)sender

    Parameters

    sender

    The object sending this message.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Launches Address Book to edit the item selected in the people picker.

    Declaration

    Swift

    func editInAddressBook(_ sender: AnyObject!)

    Objective-C

    - (void)editInAddressBook:(id)sender

    Parameters

    sender

    The object sending this message.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • The action to be invoked when a group is double-clicked.

    Declaration

    Swift

    var groupDoubleAction: Selector

    Objective-C

    @property(nonatomic, assign) SEL groupDoubleAction

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • The action to be invoked when a name is double-clicked.

    Declaration

    Swift

    var nameDoubleAction: Selector

    Objective-C

    @property(nonatomic, assign) SEL nameDoubleAction

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • Launches Address Book and selects the item selected in the people picker.

    Declaration

    Swift

    func selectInAddressBook(_ sender: AnyObject!)

    Objective-C

    - (void)selectInAddressBook:(id)sender

    Parameters

    sender

    The object sending this message.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • target target Property

    The target for double-click actions.

    Declaration

    Swift

    unowned(unsafe) var target: AnyObject!

    Objective-C

    @property(nonatomic, assign) id target

    Discussion

    The target is the object on which the action specified by groupDoubleAction and nameDoubleAction is invoked.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • The name under which the column positions and the filter selection are saved.

    Declaration

    Swift

    var autosaveName: String!

    Objective-C

    @property(nonatomic, retain) NSString *autosaveName

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.

  • These constants are of the type Selection Behavior and are used by valueSelectionBehavior.

    Declaration

    Swift

    struct ABPeoplePickerSelectionBehavior { init(_ value: UInt32) var value: UInt32 }

    Objective-C

    typedef enum { ABNoValueSelection = 0, ABSingleValueSelection = 1, ABMultipleValueSelection = 2 } ABPeoplePickerSelectionBehavior;

    Constants

    • ABNoValueSelection

      ABNoValueSelection

      The user cannot select individual values.

      Available in OS X v10.3 and later.

    • ABSingleValueSelection

      ABSingleValueSelection

      The user can select a single value.

      Available in OS X v10.3 and later.

    • ABMultipleValueSelection

      ABMultipleValueSelection

      The user can select multiple values.

      Available in OS X v10.3 and later.

    Import Statement

    Objective-C

    @import AddressBook;

    Swift

    import AddressBook

    Availability

    Available in OS X v10.3 and later.