3

I wanted to know if I can hide the Action button on the UIDocumentInteractionController so a user couldn't actually open the document in another app?

enamrik
  • 2,292
  • 2
  • 27
  • 42

2 Answers2

0

The whole purpose of the UIDocumentInteractionController is to show the user which applications can handle a file and give them a way to 'send' the file to the app they choose. Since hiding/disabling the button would confuse the user, I doubt it is possible (at least not without resorting to undocumented method calls).

RyanR
  • 7,728
  • 1
  • 25
  • 39
0

I found something that works for me well enough:

- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller   canPerformAction:(SEL)action{
    return false;
}

It still shows the button but the popover that appears only has the print form but the print button is disabled.

enamrik
  • 2,292
  • 2
  • 27
  • 42
  • I could not get this delegated method to get called. Any idea what missing? – user523234 Feb 13 '12 at 00:18
  • 4
    @user523234 This method is deprecated in iOS 6. If you use it, the following message gets logged: "UIDocumentInteractionControllerDelegate implements legacy action methods. Please remove them." – mkerley Apr 11 '13 at 23:46