iOS Developer Library

Developer

UIKit Framework Reference UIMenuItem Class Reference

Options
Deployment Target:

On This Page
Language:

UIMenuItem

An instance of the UIMenuItem class represents a custom item in the editing menu managed by the UIMenuController object. More...

Inheritance


Conforms To


Import Statement


import UIKit @import UIKit;

Availability


Available in iOS 3.2 and later.
  • Creates and returns a menu-item object initialized with the given title and action.

    Declaration

    Swift

    init(title title: String, action action: Selector)

    Objective-C

    - (instancetype)initWithTitle:(NSString *)title action:(SEL)action

    Parameters

    title

    The title of the menu item.

    action

    A selector identifying the method of the responder object to invoke for handling the command represented by the menu item.

    Return Value

    An initialized UIMenuItem object, or nil if there was a problem creating the object.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • title title Property

    The title of the menu item.

    Declaration

    Swift

    var title: String!

    Objective-C

    @property(nonatomic, copy) NSString *title

    Discussion

    The title cannot be nil.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • action action Property

    A selector identifying the method of the responder object to invoke for handling of the menu command.

    Declaration

    Swift

    var action: Selector

    Objective-C

    @property(nonatomic) SEL action

    Discussion

    The action selector cannot be NULL.

    Import Statement

    import UIKit

    Availability

    Available in iOS 3.2 and later.