【问题标题】:iOS - allow app to receive image from another appiOS - 允许应用程序从另一个应用程序接收图像
【发布时间】:2013-10-02 03:20:09
【问题描述】:

我们希望允许开发人员通过 UIActivity 向我们的应用发送图像。

我们如何设置我们的应用程序来支持这一点?

【问题讨论】:

    标签: uiimage uiactivity


    【解决方案1】:

    您的应用需要注册它支持的文件类型。要注册文件类型,您的应用程序必须在其 Info.plist 属性列表文件中包含 CFBundleDocumentTypes 键。请参阅Apple docs 了解更多信息。

    <dict>
       <key>CFBundleTypeName</key>
       <string>My File Format</string>
       <key>CFBundleTypeIconFiles</key>
           <array>
               <string>MySmallIcon.png</string>
               <string>MyLargeIcon.png</string>
           </array>
       <key>LSItemContentTypes</key>
           <array>
               <string>com.example.myformat</string>
           </array>
       <key>LSHandlerRank</key>
       <string>Owner</string>
    </dict>
    

    【讨论】:

    • 这将使您的应用程序可从UIDocumentInteractionController 获得。没有办法让您的应用在 UIActivityViewController 中可用,这是使用 UIActivity 实例的地方。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多