IOS 8在我的应用程序中从其他应用程序打开图像
我做了一些研究,但似乎仍然没有运气
I did some research but seems still no luck
当我在我的info.plist中添加这些xml
when I added these xml in my info.plist
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeIdentifier</key>
<string>my.custom.uti</string>
<key>UTTypeDescription</key>
<string>PDF file</string>
</dict>
</array>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>LSItemContentTypes</key>
<array>
<string>public.data</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>Icon.png</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeName</key>
<string>my.custom.uti</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
</array>
我发送3封电子邮件给自己。
1 - pdf文件。
2 - png文件。
3 - jpg和png文件。
and I send 3 email to myself. 1 - pdf file. 2 - png file. 3 - jpg and png file.
当我添加这些xmls时,我的应用程序可以在pdf和txt文件中显示,当点击打开...时
但我想要的是在图像中打开。
出了什么问题?
和我设置UITTypeConformsTo = public.data假设它是一般值。所以我的应用程序可以打开所有格式(至少pdf和图像),但似乎不。
when i added these xmls, my app can shows in pdf and txt file, when clicked "open with..." but what I want is open with in images. anything goes wrong?? and I set UITTypeConformsTo = public.data suppose that it is a general value. So that my app can open all the formats(at least pdf and images) , but seems it dont.
我也尝试将此答案中的xml复制到我的info.plist
https://*.com/a/11609935/1061074 仍然没有运气
I also try to copy the xml in this answer to my info.plist https://*.com/a/11609935/1061074 still no luck
它一切都取决于主机应用程序*享按钮的实现方式。在iOS8中,实际上有两种不同的方法:(1)在Info.plist中使用CFBundleDocumentTypes,以及(2)应用程序扩展。一些应用程序,如GMail& AVR支持(1)和(2)。但Dropbox仅支持(2)。这就是为什么CFBundleDocumentTypes不再适用于Dropbox的原因。当然,事情可能会在以后发生变化。
It all depends on how "share" button in the host app is implemented. In iOS8, there are actually two different ways to do this: (1) using CFBundleDocumentTypes in Info.plist, and (2) Application Extension. Some apps such as GMail & AVR support both (1) & (2). But Dropbox supports (2) only. That's why CFBundleDocumentTypes does not work in Dropbox anymore. Of course, things may change later.