Mac Developer Library

Developer

Collaboration Framework Reference CBIdentityPicker Class Reference

Options
Deployment Target:

On This Page
Language:

CBIdentityPicker

A CBIdentityPicker object allows a user to select identities—for example, user or group objects—that it wants one or more services or shared resources to have access to. An identity picker can be displayed either as an application-modal dialog or as a sheet attached to a document window. An identity picker returns the selected records to be added to access control lists using Collaboration. If a selected record is not a user or group identity, then an identity picker prompts the end user for additional information—such as a password—to promote that record to a sharing account.

  • Runs the receiver modally as a sheet attached to a specified window.

    Declaration

    Swift

    func runModalForWindow(_ window: NSWindow, modalDelegate delegate: AnyObject?, didEndSelector didEndSelector: Selector, contextInfo contextInfo: UnsafeMutablePointer<Void>)

    Objective-C

    - (void)runModalForWindow:(NSWindow *)window modalDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo

    Parameters

    window

    The parent window for the sheet.

    delegate

    The delegate for the modal session.

    didEndSelector

    A message sent to the delegate after the user responds but before the sheet is dismissed.

    contextInfo

    Contextual data passed to the delegate in the didEndSelector message.

    Discussion

    The didEndSelector parameter is a selector that takes three arguments. The corresponding method should have a declaration modeled on the following example:

    1. - (void)identityPickerDidEnd:(CBIdentityPicker *)identityPicker returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;

    where the identityPicker argument is the identity picker object, the returnCode argument is the button the user clicked, and contextInfo is the same contextInfo argument that was passed in the original message.

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.11.

  • Runs the receiver as an application-modal dialog.

    Declaration

    Swift

    func runModal() -> Int

    Objective-C

    - (NSInteger)runModal

    Return Value

    NSOKButton if the user selected OK; otherwise, NSCancelButton.

    Discussion

    The receiver may create identities for selected records if necessary.

    Availability

    Available in OS X v10.5 and later.

  • Returns an array of the identities selected using the identity picker.

    Declaration

    Swift

    var identities: [CBIdentity] { get }

    Objective-C

    @property(readonly, nonatomic) NSArray<CBIdentity *> *identities

    Return Value

    An array of the selected identities.

    Discussion

    The array contains CBIdentity objects.

    Availability

    Available in OS X v10.5 and later.

  • Sets the title of the identity picker.

    Declaration

    Swift

    var title: String?

    Objective-C

    @property(readwrite, nonatomic, copy) NSString *title

    Parameters

    title

    The title of the identity picker.

    Availability

    Available in OS X v10.5 and later.

  • Returns the title of the identity picker.

    Declaration

    Swift

    var title: String?

    Objective-C

    @property(readwrite, nonatomic, copy) NSString *title

    Return Value

    The title of the identity picker.

    Availability

    Available in OS X v10.5 and later.

  • Allows a user to make select multiple identities.

    Declaration

    Swift

    var allowsMultipleSelection: Bool

    Objective-C

    @property(readwrite, nonatomic) BOOL allowsMultipleSelection

    Parameters

    flag

    YEStrue if you can select multiple records; otherwise, NOfalse.

    Discussion

    By default, you cannot select multiple records.

    Availability

    Available in OS X v10.5 and later.

  • Returns a Boolean value indicating whether the user is allowed to select multiple identities.

    Declaration

    Swift

    var allowsMultipleSelection: Bool

    Objective-C

    @property(readwrite, nonatomic) BOOL allowsMultipleSelection

    Return Value

    YEStrue if the user can select multiple records; otherwise, NOfalse.

    Availability

    Available in OS X v10.5 and later.