ios - iOS 共享扩展中的子查询排除文件类型
<p><p>我的共享扩展有以下 NSExtensionActivationRule,它允许我的应用程序与图像和 pdf 文件交互:</p>
<pre><code>SUBQUERY (
extensionItems, $extensionItem,
SUBQUERY (
$extensionItem.attachments, $attachment,
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url"
).@count == 1
).@count > 0
</code></pre>
<p>但是,由于我使用不同的方法访问我自己的文件,我需要不为我的应用程序文档类型为 <code>com.myApp.extension</code> 的文件显示我的应用程序。 <br/>有没有改进的方法:<br/><br/> <code>ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url</code><br/><br/> 这样它排除特定类型的文件。</p>
<p>谢谢<br/>
礼萨</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><pre><code><key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>
SUBQUERY (
extensionItems,
$extensionItem,
SUBQUERY (
$extensionItem.attachments,
$attachment,
(ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf" OR
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.file-url" OR
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" OR
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg" OR
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png")
AND NOT (ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "your.unique.uti.here")
).@count == $extensionItem.attachments.@count
).@count == 1
</string>
</dict>
</code></pre></p>
<p style="font-size: 20px;">关于ios - iOS 共享扩展中的子查询排除文件类型,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/40016837/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/40016837/
</a>
</p>
页:
[1]