如何在iOS 9中与共享扩展共享笔记数据?

时间:2015-08-31 07:02:47

标签: ios objective-c iphone ios9 ios-extensions

我的应用程序工作正常,直到iOS 8但在iOS 9 Beta中,我无法共享Notes文本/图像所以,请您建议我认为我需要为此实现什么?

2 个答案:

答案 0 :(得分:6)

Add **NSExtensionActivationDictionaryVersion** Attributes in your plist file.

请参阅此图片以供参考。

enter image description here

答案 1 :(得分:2)

如果我在NSExtensionActivationRule中使用NSPredicate,该怎么用?

<key>NSExtensionAttributes</key>
    <dict>
        <key>NSExtensionActivationRule</key>
        <string>
            SUBQUERY(
            extensionItems,
            $extensionItem,
            SUBQUERY
            (
            $extensionItem.attachments,
            $attachment,
            ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie"
            ).@count == $extensionItem.attachments.@count AND $extensionItem.attachments.@count == 1
            ).@count > 0
            OR
            SUBQUERY(
            extensionItems,
            $extensionItem,
            SUBQUERY
            (
            $extensionItem.attachments,
            $attachment,
            ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image"
            || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png"
            || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg"
            || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg-2000"
            || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.tiff"
            || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.compuserve.gif"
            || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.microsoft.bmp"
            ).@count == $extensionItem.attachments.@count AND $extensionItem.attachments.@count &lt; 6
            ).@count > 0
</string>
</dict>