Conforms to | |
Framework | /System/Library/Frameworks/UIKit.framework |
Availability | Available in iOS 3.2 and later. |
Declared in | UIDocumentInteractionController.h |
The UIDocumentInteractionControllerDelegate
protocol includes methods that you use to respond to events in a document interaction controller object. You can use this protocol to determine when document previews are displayed and when a document is about to be opened by another application. You also use it to support commands (such as the copy command) that affect documents.
If you use a document interaction controller to display a document preview, your delegate must implement the documentInteractionControllerViewControllerForPreview:
method. All other methods of the protocol are optional.
For more information about using a document interaction controller object, see UIDocumentInteractionController Class Reference.
– documentInteractionControllerViewControllerForPreview:
– documentInteractionControllerViewForPreview:
– documentInteractionControllerRectForPreview:
– documentInteractionControllerWillBeginPreview:
– documentInteractionControllerDidEndPreview:
– documentInteractionControllerWillPresentOptionsMenu:
– documentInteractionControllerDidDismissOptionsMenu:
– documentInteractionControllerWillPresentOpenInMenu:
– documentInteractionControllerDidDismissOpenInMenu:
– documentInteractionController:willBeginSendingToApplication:
– documentInteractionController:didEndSendingToApplication:
Asks the delegate whether the specified action can be performed on the target document.
- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller canPerformAction:(SEL)action
The document interaction controller managing the target document.
A selector for the action method in question.
YES
if the specified action is supported on the target document or NO
if it is not. If you do not implement this method, the return value is assumed to be NO
.
When building the options menu, the document interaction controller calls this method to find out if your application is able to perform the indicated action. (If you implement this method, you must also implement the documentInteractionController:performAction:
method for the given action.)
Currently only the copy:
action is supported. If your application supports copying the document contents, you should return YES
and use the documentInteractionController:performAction:
to perform the copy operation.
UIDocumentInteractionController.h
Tells the delegate that the document was handed off to the specified application
- (void)documentInteractionController:(UIDocumentInteractionController *)controller didEndSendingToApplication:(NSString *)application
The document interaction controller whose document is about to be opened.
The bundle identifier of the application that is about to open the document. This value corresponds to the value in the CFBundleIdentifier
key of the application’s Info.plist
file.
This method is called after the document information has been saved for the specified application.
UIDocumentInteractionController.h
Tells the delegate to perform the specified action on the target document.
- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller performAction:(SEL)action
The document interaction controller managing the target document.
A selector representing the action to perform. You can invoke this selector directly on the object responsible for performing the action or use it to call the appropriate method.
YES
if the action was performed successfully or NO
if it was not.
Currently only the copy:
action is supported. Your implementation of this method should write the contents of the document to the pasteboard when the action is performed.
UIDocumentInteractionController.h
Tells the delegate that the document is about to be opened by the specified application
- (void)documentInteractionController:(UIDocumentInteractionController *)controller willBeginSendingToApplication:(NSString *)application
The document interaction controller whose document is about to be opened.
The bundle identifier of the application that is about to open the document. This value corresponds to the value in the CFBundleIdentifier
key of the application’s Info.plist
file.
This method is called when the user chooses to open a document, which could occur from within a document preview. When a document is passed to another application, the contents of the document interaction controller’s annotation
property are passed with it. You can use this method to configure the contents of that property or prepare your own application for handing off the document.
UIDocumentInteractionController.h
Tells the delegate that the interaction controller dismissed its Open In menu.
- (void)documentInteractionControllerDidDismissOpenInMenu:(UIDocumentInteractionController *)controller
The document interaction controller that dismissed its menu.
You can use this method to remove any additional views or content you placed underneath the Open In menu in your documentInteractionControllerWillPresentOpenInMenu:
method.
UIDocumentInteractionController.h
Tells the delegate that the interaction controller dismissed its options menu.
- (void)documentInteractionControllerDidDismissOptionsMenu:(UIDocumentInteractionController *)controller
The document interaction controller that dismissed its options menu.
You can use this method to remove any additional views or content you placed underneath the options menu in your documentInteractionControllerWillPresentOptionsMenu:
method.
UIDocumentInteractionController.h
Tells the delegate that the interaction controller dismissed its document preview.
- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller
The document interaction controller that dismissed its document preview.
This method is called after the view containing the document preview has been removed from the application’s key window. You can use this notification to remove any interface elements you set up behind the preview elements.
UIDocumentInteractionController.h
Asks the delegate for the rectangle to use as the starting point for animating the display of the document preview.
- (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller
The document interaction controller requesting the starting rectangle.
A rectangle in the coordinate system of the view returned by the documentInteractionControllerViewForPreview:
method.
If you do not implement the documentInteractionControllerViewForPreview:
method, or if you do implement it but return a nil
value, this method is not called. If you do not implement this method, the starting rectangle is assumed to be the bounds of the view returned by the documentInteractionControllerViewForPreview:
method.
UIDocumentInteractionController.h
Asks the delegate for the view controller to use when presenting the document preview.
- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
The document interaction controller requesting the parent view controller.
The view controller to use when presenting the document preview. The return value must not be nil
.
Although technically optional, this method is required if your application attempts to display a preview for a document. The view controller returned by this method is used as the parent for the document preview.
If you return a navigation controller from this method, the document interaction controller is pushed onto the navigation stack using the standard navigation controller animations. If you return any other type of view controller, the document interaction controller is displayed modally, in which case, the view controller you return must be capable of presenting a modal view controller.
UIDocumentInteractionController.h
Asks the delegate for the view to use as the starting point for animating the display of the document preview.
- (UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller
The document interaction controller requesting the starting view.
The view to use as the starting point for the animation or nil
if you want the document preview to fade into place.
By default, the starting rectangle for the animation is set to the bounds of the returned view. To specify a different starting rectangle, you must also override the documentInteractionControllerRectForPreview:
method.
UIDocumentInteractionController.h
Tells the delegate that the interaction controller is about to display a preview for its document.
- (void)documentInteractionControllerWillBeginPreview:(UIDocumentInteractionController *)controller
The document interaction controller that is about to preview its document.
This method is called shortly before the view containing the document preview is presented modally. You can use this notification to set up any additional interface elements behind the preview elements.
UIDocumentInteractionController.h
Tells the delegate that the interaction controller is about to display an Open In menu.
- (void)documentInteractionControllerWillPresentOpenInMenu:(UIDocumentInteractionController *)controller
The document interaction controller that is about to display a menu.
The Open In menu is used to select an application for opening the current file. You can use this method to update your user interface in response to displaying the menu.
UIDocumentInteractionController.h
Tells the delegate that the interaction controller is about to display an options menu.
- (void)documentInteractionControllerWillPresentOptionsMenu:(UIDocumentInteractionController *)controller
The document interaction controller that is about to display an options menu.
The Open In menu is used to present the user with options for previewing the document, opening it in an application, or copying its contents. You can use this method to update your user interface in response to displaying the menu.
UIDocumentInteractionController.h
Last updated: 2010-05-14