Mac Developer Library

Developer

AppKit Framework Reference NSTokenField Class Reference

Options
Deployment Target:

On This Page
Language:

NSTokenField

Conforms To


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.4 and later.

NSTokenField is a subclass of NSTextField that provides tokenized editing similar to the address field in the Mail application.

NSTokenField uses an NSTokenFieldCell to implement much of the control’s functionality. NSTokenField provides cover methods for most methods of NSTokenFieldCell, which invoke the corresponding cell method.

  • Returns the token style of the receiver.

    Declaration

    Swift

    var tokenStyle: NSTokenStyle

    Objective-C

    @property NSTokenStyle tokenStyle

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    See Also

    – tokenStyle

  • Returns the receiver’s token style.

    Declaration

    Swift

    var tokenStyle: NSTokenStyle

    Objective-C

    @property NSTokenStyle tokenStyle

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets the receiver’s completion delay.

    Declaration

    Swift

    var completionDelay: NSTimeInterval

    Objective-C

    @property NSTimeInterval completionDelay

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the receiver’s completion delay.

    Declaration

    Swift

    var completionDelay: NSTimeInterval

    Objective-C

    @property NSTimeInterval completionDelay

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the default completion delay.

    Declaration

    Swift

    class func defaultCompletionDelay() -> NSTimeInterval

    Objective-C

    + (NSTimeInterval)defaultCompletionDelay

    Discussion

    The default completion delay is 0.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Returns the token field’s delegate.

    Declaration

    Swift

    func delegate() -> NSTokenFieldDelegate?

    Objective-C

    - (id<NSTokenFieldDelegate>)delegate

    Return Value

    The token field’s delegate

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • Sets the token field’s delegate

    Declaration

    Swift

    func setDelegate(_ anObject: NSTokenFieldDelegate?)

    Objective-C

    - (void)setDelegate:(id<NSTokenFieldDelegate>)anObject

    Parameters

    anObject

    The delegate for the receiver. The delegate must conform to the NSTokenFieldDelegate Protocol protocol.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.6 and later.

    See Also

    – delegate