NSMenuItem

extension NSMenuItem
  • A convenience init for NSMenuItem.

    Declaration

    Swift

    public convenience init(title: String,
                            image: NSImage? = nil,
                            target: AnyObject? = nil,
                            action: Selector? = nil,
                            keyEquivalent: String = "",
                            isEnabled: Bool = true)

    Parameters

    title

    The title of the menu item.

    image

    The image for the menu item.

    target

    The target to be associated with the menu item.

    action

    The action selector to be associated with the menu item.

    keyEquivalent

    A string representing a keyboard key to be used as the key equivalent.

    isEnabled

    A Boolean value that indicates whether the menu item is enabled.