在+ UIDocumentInteractionController中打开:如何过滤iOS iOS 6中的选项(不推荐使用canPerformActions) [英] Open in + UIDocumentInteractionController : how to filter options in SDK iOS 6 (canPerformActions is deprecated)

查看:799
本文介绍了在+ UIDocumentInteractionController中打开:如何过滤iOS iOS 6中的选项(不推荐使用canPerformActions)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自新SDK发布(iOS 6)以来, UIDocumentInteractionControllerDelegate 的委托方法 documentInteractionController:canPerformAction:不推荐使用。

Since the new SDK was release (iOS 6), the delegate method documentInteractionController:canPerformAction: of the UIDocumentInteractionControllerDelegate is deprecated.

使用该方法可以防止默认操作,例如 print: copy:出现。

Using that method you were able to prevent default actions like print: and copy: to appear.

该方法是在当前版本的iOS 6中调用的,但在将来的版本中,此方法不会调用,我的应用程序将显示我不想支持的操作。

The method is being called in the current version of iOS 6, but in future versions this method will not be called and my app will show actions that I don't want to support.

我阅读了UIDocumentInteractionController及其委托的可用文档,我无法找到另一种方法来做我在canPerformAction方法中所做的事情。

I read the available documentation for the UIDocumentInteractionController and its delegate and I'm not able to find a another way to do what I do in the canPerformAction method.

任何想法?

作为一个加号,能够过滤诸如邮件或推特之类的应用程序(默认显示)会很棒,但我想这是不可能的。

As a plus, it would be great to be able to filter apps like mail or twitter (that appears by default) but I guess that this is not possible.

推荐答案

我认为这是因为Apple想要的您可以使用新的 UIActivity 控件。

I think it is because Apple wants you to use the new UIActivity control.

这是文档:

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIActivity_Class/Reference /Reference.html

这是为支持许多第三方应用而开发的自定义控件:

Here it's a custom control developed to support many third party apps:

http://www.cocoacontrols.com/platforms/ios/controls/uiactivitycollection

这个问题解决了你如何制作自己的 UIActivity

And this question solves how could you make your own UIActivity:

https://stackoverflow.com/a/12766330/736384

因此,如果您不希望用户可以使用 copy: print:方法,只需将此活动传递给 UIActivityViewControll呃,像这样:

So, if you don't want the user can use copy: and print: methods just pass this activities to the UIActivityViewController, like this:

[activityView setExcludedActivityTypes:[NSArray arrayWithObjects:UIActivityTypeCopyToPasteboard, UIActivityTypePrint, nil]];

所有默认活动都列在Apple文档链接的底部。

All the default activities are listed at the bottom of the Apple's documentation link.

这篇关于在+ UIDocumentInteractionController中打开:如何过滤iOS iOS 6中的选项(不推荐使用canPerformActions)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆