简体   繁体   English

使用iOS Share Extension进行图像抓取

[英]Image Grabbing with iOS Share Extension

如何检查应用程序或页面上是否有要抓取的图像,然后使用SWIFT从iOS共享扩展程序中抓取图像以供以后使用?

You are thinking about this backwards, iOS will do that for you. 您正在考虑这个问题,iOS将为您完成。 All you can/have to do is define what you accept, see and keep in mind that by default all documents you accept have to be present at once or the share won't show up NSExtensionActivationRule 您可以/仅需要定义接受的内容,请注意并记住默认情况下,您接受的所有文档必须一次显示, 否则共享不会显示NSExtensionActivationRule

you can determine this using the ExtensionPreprocessingJS, in the run function 您可以在运行功能中使用ExtensionPreprocessingJS确定这一点

run: function(arguments) {
   arguments.completionFunction({"numberImages" : document.images.length});
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM