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.

Inheritance


Conforms To


Import Statement


Swift

import Collaboration

Objective-C

@import Collaboration;

Availability


Available in OS X v10.5 and later.
  • 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:

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

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.

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

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func identities() -> [AnyObject]!

    Objective-C

    - (NSArray *)identities

    Return Value

    An array of the selected identities.

    Discussion

    The array contains CBIdentity objects.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.

  • Sets the title of the identity picker.

    Declaration

    Swift

    func setTitle(_ title: String!)

    Objective-C

    - (void)setTitle:(NSString *)title

    Parameters

    title

    The title of the identity picker.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.

  • Returns the title of the identity picker.

    Declaration

    Swift

    func title() -> String!

    Objective-C

    - (NSString *)title

    Return Value

    The title of the identity picker.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.

  • Allows a user to make select multiple identities.

    Declaration

    Swift

    func setAllowsMultipleSelection(_ flag: Bool)

    Objective-C

    - (void)setAllowsMultipleSelection:(BOOL)flag

    Parameters

    flag

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

    Discussion

    By default, you cannot select multiple records.

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    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

    func allowsMultipleSelection() -> Bool

    Objective-C

    - (BOOL)allowsMultipleSelection

    Return Value

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

    Import Statement

    Objective-C

    @import Collaboration;

    Swift

    import Collaboration

    Availability

    Available in OS X v10.5 and later.