(informal protocol)
Framework | /System/Library/Frameworks/UIKit.framework |
Declared in | UIResponder.h |
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.
Although this is an informal protocol—that is, a category declared on NSObject
—it is recommended that responder classes (that is, immediate or distant ancestors of UIResponder
) override its methods. Starting with the first responder, UIResponder
looks for a responder object that can handle the method, and works up the responder chain from there. Responder classes may also implement the canPerformAction:withSender:
method of UIResponder
to disable or enable user-interface commands based on the context. The copy:
, cut:
, delete:
, paste:
, select:
, and selectAll:
methods are invoked when users tap the corresponding command in the menu managed by the UIMenuController
shared instance.
– select:
required method
– selectAll:
required method
Copy the selection to the pasteboard. (required)
- (void)copy:(id)sender
The object calling this method.
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.
UIResponder.h
Remove the selection from the user interface and write it to the pasteboard. (required)
- (void)cut:(id)sender
The object calling this method.
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.
UIResponder.h
Remove the selection from the user interface. (required)
- (void)delete:(id)sender;
The object calling this method.
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.
UIResponder.h
Read data from the pasteboard and display it in the user interface. (required)
- (void)paste:(id)sender
The object calling this method.
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.
UIResponder.h
Select the next object the user taps. (required)
- (void)select:(id)sender
The object calling this method.
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.
UIResponder.h
Select all objects in the current view. (required)
- (void)selectAll:(id)sender
The object calling this method.
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.
UIResponder.h
Last updated: 2010-02-25