Contents

doCommand(by:command:)

Passes commands that are not generated as part of the text input process.

Declaration

func doCommand(by aSelector: Selector!, command infoDictionary: [AnyHashable : Any]!)

Parameters

  • aSelector:

    A selector that represents a command from the text input menu.

  • infoDictionary:

    A dictionary that contains two key-value pairs:

Discussion

The default implementation checks if the input controller object (that is, self) responds to the selector. If so, it sends the message perform(_:with:) to the input controller class. The object parameter in that case is the infoDictionary parameter.

This method is called when a user selects a command from the text input menu. To support this, an input method must provide actions for each menu item that is placed in the menu. For example, (void)menuAction:(id)sender. Note that the sender in this instance is the info dictionary.

See Also

Working with Custom Commands