如何在 plist 中定义统一类型标识符以在共享操作 sheet 中添加我的 iOS 应用程序选项?
How to define Uniforme Type Identifier in plist to add my iOS app option in share action sheet?
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>72x72.png</string>
<string>144x144.png</string>
</array>
<key>CFBundleTypeName</key>
<string>JPEG</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.ngnew.NG.ShareJPEG</string>
<string>com.ngnew.NG.ShareJPG</string>
<string>com.ngnew.NG.mime-type</string></array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.jpeg</string>
</array>
<key>UTTypeDescription</key>
<string>JPEG</string>
<key>UTTypeIdentifier</key>
<string>com.ngnew.NG.ShareJPEG</string>
<key>UTTypeSize320IconFile</key>
<string>144x144</string>
<key>UTTypeSize64IconFile</key>
<string>72x72</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.ngnew.NG.ShareJPEG</key>
<array>
<string>jpeg</string>
<string>jpg</string>
</array>
<key>com.ngnew.NG.ShareJPG</key>
<string>JPEG</string>
<key>com.ngnew.NG.mime-type</key>
<string>image/jpeg</string>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.image</string>
</array>
<key>UTTypeDescription</key>
<string>JPEG image</string>
<key>UTTypeIdentifier</key>
<string>com.ngios.newios</string>
<key>UTTypeSize320IconFile</key>
<string>144x144</string>
<key>UTTypeSize64IconFile</key>
<string>72x72</string>
</dict>
</array>
我在 plist
中使用了上面的代码,但是,我在我的应用程序中看不到结果。我也提到了很多其他的例子,但我在某处做错了。
我希望 UIActivityViewController
中的 iOS 应用程序选项在分享操作 sheet 中分享图像或文本或两者到我的 iOS 应用程序。
解决方案是 ShareExtension(Xcode -> 文件 -> 目标 -> ShareExtension)
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>72x72.png</string>
<string>144x144.png</string>
</array>
<key>CFBundleTypeName</key>
<string>JPEG</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.ngnew.NG.ShareJPEG</string>
<string>com.ngnew.NG.ShareJPG</string>
<string>com.ngnew.NG.mime-type</string></array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.jpeg</string>
</array>
<key>UTTypeDescription</key>
<string>JPEG</string>
<key>UTTypeIdentifier</key>
<string>com.ngnew.NG.ShareJPEG</string>
<key>UTTypeSize320IconFile</key>
<string>144x144</string>
<key>UTTypeSize64IconFile</key>
<string>72x72</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.ngnew.NG.ShareJPEG</key>
<array>
<string>jpeg</string>
<string>jpg</string>
</array>
<key>com.ngnew.NG.ShareJPG</key>
<string>JPEG</string>
<key>com.ngnew.NG.mime-type</key>
<string>image/jpeg</string>
</dict>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.image</string>
</array>
<key>UTTypeDescription</key>
<string>JPEG image</string>
<key>UTTypeIdentifier</key>
<string>com.ngios.newios</string>
<key>UTTypeSize320IconFile</key>
<string>144x144</string>
<key>UTTypeSize64IconFile</key>
<string>72x72</string>
</dict>
</array>
我在 plist
中使用了上面的代码,但是,我在我的应用程序中看不到结果。我也提到了很多其他的例子,但我在某处做错了。
我希望 UIActivityViewController
中的 iOS 应用程序选项在分享操作 sheet 中分享图像或文本或两者到我的 iOS 应用程序。
解决方案是 ShareExtension(Xcode -> 文件 -> 目标 -> ShareExtension)