Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable action items in UIDocumentInteractionController's presentPreviewAnimated

I am using UIDocumentInteractionController's presentPreviewAnimated method to preview document. It works fine. But I wish to disable the action button while in the preview mode. I have the following two delegated methods to return NO. But these two methods never got called at all. The other delegated methods work fine. Any suggestion?

-(BOOL)documentInteractionController:(UIDocumentInteractionController *)controller canPerformAction:(SEL)action {
NSLog(@"canPerformAction");
return NO;
}

and

-(BOOL)documentInteractionController:(UIDocumentInteractionController *)controller performAction:(SEL)action {
NSLog(@"performAction");
return NO;
}
like image 918
user523234 Avatar asked Jul 17 '26 18:07

user523234


1 Answers

I finally switched to use the QLPreviewController class. Where you can subclass it and make the action button gone away. (With the help from the answer by rbrown of this SO.

like image 152
user523234 Avatar answered Jul 20 '26 09:07

user523234