I have code to display a document as follows:
documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:self.thisUrl]; NSString *pathExtension = [self.thisUrl pathExtension]; if (pathExtension) { NSString *UTI = (__bridge NSString*)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)(pathExtension), NULL); if (UTI) { documentInteractionController.UTI = UTI; } } documentInteractionController.delegate = self; [documentInteractionController presentOptionsMenuFromBarButtonItem:shareButton animated:YES];
When the options menu is displayed, it displays a list of applications that can open the document (such as a message), as well as a list of actions below.
The options menu displays list actions other than the menu shown, for example, in the Mail application.
The main difference is that the Mail application shows the "print" option, while there are no options in my menu. How to get the options menu to show the print option?


EDIT: I did another test where I implemented the methods:
- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller canPerformAction:(SEL)action { return YES; } - (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller performAction:(SEL)action { return YES;
This affected the display of the “print”, “copy” and “save to camera” actions in a pop-up window. Nothing happened when I clicked on them, possibly because I didn’t use -performAction . I also get a warning in the console log about using deprecated methods.
It was a step back in some way because I could no longer print some documents that could print correctly with the document interaction controller before adding these methods.
ios uidocumentinteraction
1800 INFORMATION
source share