我开发了一个共享扩展并从照片和笔记应用程序中导入照片和笔记。我想将可以导入的照片数量限制为 10,但对于照片,我可以选择无限的照片。以下是来自扩展名 info.plist 的查询。任何人都可以调查它并指导我更正查询。
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>SUBQUERY (
extensionItems,
$extensionItem,
SUBQUERY (
$extensionItem.attachments,
$attachment,
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image"
).@count == $extensionItem.attachments.@count).@count == 1
OR
SUBQUERY(extensionItems, $extensionItem, SUBQUERY($extensionItem.attachments, $attachment, SUBQUERY($attachment.registeredTypeIdentifiers, $uti, NOT $uti UTI-CONFORMS-TO "public.url" AND NOT $uti UTI-CONFORMS-TO "public.file-url" AND $uti UTI-CONFORMS-TO "public.plain-text").@count >= 1).@count >= 1).@count >= 1
</string>
</dict>