Protocol: UIResponderStandardEditActions

Overview

The UIResponderStandardEditActions informal protocol declares methods that responder classes should override to handle common editing commands invoked in the user interface, such as Copy, Paste, and Select.Copy the selection to the pasteboard.Remove the selection from the user interface and write it to the pasteboard.Remove the selection from the user interface.Change the writing direction to left-to-right. Change the writing direction to right-to-left.Read data from the pasteboard and display it in the user interface.Select the next object the user taps. Select all objects in the current view.Toggle the bold style information of the selected text. Toggle the italic style information of the selected text.Toggle the underline style information of the selected text.

Instance Method Summary (collapse)

Instance Method Details

- (Object) copy(sender)

Copy the selection to the pasteboard. This method is invoked when the user taps the Copy command of the editing menu. A subclass of UIResponder typically implements this method. Using the methods of the UIPasteboard class, it should convert the selection into an appropriate object (if necessary) and write that object to a pasteboard. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) cut(sender)

Remove the selection from the user interface and write it to the pasteboard. This method is invoked when the user taps the Cut command of the editing menu. A subclass of UIResponder typically implements this method. Using the methods of the UIPasteboard class, it should convert the selection into an appropriate object (if necessary) and write that object to a pasteboard. It should also remove the selected object from the user interface and, if applicable, from the application’s data model. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) delete(sender)

Remove the selection from the user interface. This method is invoked when the user taps the Delete command of the editing menu. A subclass of UIResponder typically implements this method by removing the selected object from the user interface and, if applicable, from the application’s data model. It should not write any data to the pasteboard. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) makeTextWritingDirectionLeftToRight(sender)

Change the writing direction to left-to-right. A subclass of UIResponder typically implements this method by changing the current writing direction of its text editing area. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) makeTextWritingDirectionRightToLeft(sender)

Change the writing direction to right-to-left. A subclass of UIResponder typically implements this method by changing the current writing direction of its text editing area. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) paste(sender)

Read data from the pasteboard and display it in the user interface. This method is invoked when the user taps the Paste command of the editing menu. A subclass of UIResponder typically implements this method. Using the methods of the UIPasteboard class, it should read the data in the pasteboard, convert the data into an appropriate internal representation (if necessary), and display it in the user interface. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) select(sender)

Select the next object the user taps. This method is invoked when the user taps the Select command of the editing menu. This command is used for targeted selection of items in the receiving view that can be broken up into chunks. This could be, for example, words in a text view. Another example might be a view that puts lists of visible objects in multiple groups; the select: command could be implemented to select all the items in the same group as the currently selected item.A subclass of UIResponder typically implements this method. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) selectAll(sender)

Select all objects in the current view. This method is invoked when the user taps the Select All command of the editing menu. A subclass of UIResponder typically implements this method by selecting all objects in the current view. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) toggleBoldface(sender)

Toggle the bold style information of the selected text. A subclass of UIResponder typically implements this method by applying a boldface style to the selected text if it does not currently have it, or by removing the style if it does. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) toggleItalics(sender)

Toggle the italic style information of the selected text. A subclass of UIResponder typically implements this method by applying an italic style to the selected text if it does not currently have it, or by removing the style if it does. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns:

- (Object) toggleUnderline(sender)

Toggle the underline style information of the selected text. A subclass of UIResponder typically implements this method by applying an underline style to the selected text if it does not currently have it, or by removing the style if it does. The command travels from the first responder up the responder chain until it is handled; it is ignored if no responder handles it. If a responder doesn’t handle the command in the current context, it should pass it to the next responder.

Parameters:

  • sender (Object)

    The object calling this method.

Returns: