Mac Developer Library

Developer

AppKit Framework Reference NSValidatedUserInterfaceItem Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSValidatedUserInterfaceItem

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.0 and later.

The NSValidatedUserInterfaceItem protocol works with the NSUserInterfaceValidations protocol to enable or disable a control automatically, depending on whether any responder in the responder chain can handle the control’s action method. The NSMenuItem and NSToolbarItem classes implement this protocol.

By conforming to this protocol, your control can participate in this validation mechanism. To validate a control, the application calls validateUserInterfaceItem: for each item in the responder chain, starting with the first responder. If no responder returns YEStrue, the item is disabled. For example, a menu item that sends the copy: action message would disable itself if no responder in the responder chain can be copied.

  • action() - action Required

    Returns the selector of the receiver’s action method. (required)

    Declaration

    Swift

    func action() -> Selector

    Objective-C

    - (SEL)action

    Return Value

    The selector of the receiver's action method.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • tag() - tag Required

    Returns the receiver’s tag integer. (required)

    Declaration

    Swift

    func tag() -> Int

    Objective-C

    - (NSInteger)tag

    Return Value

    The receiver's tag.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.