A set of optional methods implemented by delegates of NSToken
objects.
SDK
- macOS 10.6+
Framework
- App
Kit
Declaration
protocol NSTokenFieldDelegate
A set of optional methods implemented by delegates of NSToken
objects.
SDK
Framework
protocol NSTokenFieldDelegate
func token Field(NSToken Field, display String For Represented Object: Any) -> String?
Allows the delegate to provide a string to be displayed as a proxy for the given represented object.
func token Field(NSToken Field, style For Represented Object: Any) -> NSToken Field .Token Style
Allows the delegate to return the token style for editing the specified represented object.
func token Field(NSToken Field, completions For Substring: String, index Of Token: Int, index Of Selected Item: Unsafe Mutable Pointer<Int>?) -> [Any]?
Allows the delegate to provide an array of appropriate completions for the contents of the receiver.
func token Field(NSToken Field, editing String For Represented Object: Any) -> String?
Allows the delegate to provide a string to be edited as a proxy for a represented object.
func token Field(NSToken Field, represented Object For Editing: String) -> Any?
Allows the delegate to provide a represented object for the given editing string.
func token Field(NSToken Field, should Add: [Any], at: Int) -> [Any]
Allows the delegate to validate the tokens to be added to the receiver at a particular location.
func token Field(NSToken Field, read From: NSPasteboard) -> [Any]?
Allows the delegate to return an array of objects representing the data read from the specified pasteboard.
func token Field(NSToken Field, write Represented Objects: [Any], to: NSPasteboard) -> Bool
Sent so the delegate can write represented objects to the pasteboard corresponding to a given array of display strings.
func token Field(NSToken Field, has Menu For Represented Object: Any) -> Bool
Allows the delegate to specify whether the given represented object provides a menu.
func token Field(NSToken Field, menu For Represented Object: Any) -> NSMenu?
Allows the delegate to provide a menu for the specified represented object.