iOS8 extension : share images between container and extension

后端 未结 1 1311
轻奢々
轻奢々 2020-12-21 08:19

I\'m making an iOS 8 extension. Here\'s what I\'m trying to do: Users select images from the photo library in the container app, and these images will be shared with the ext

相关标签:
1条回答
  • 2020-12-21 09:18

    From Apple's Documentation on App Extension Programming

    Sharing Data with Your Containing App

    The security domains for an app extension and its containing app are distinct, even though the extension bundle is nested within the containing app’s bundle. By default, your extension and its containing app have no direct access to each other’s containers.

    You can, however, enable data sharing. For example, you might want to allow your app extension and its containing app to share a single large set of data, such as prerendered assets.

    .....

    When you set up a shared container, the containing app—and each contained app extension that you allow to participate in data sharing—have read and write access to the shared container. To avoid data corruption, you must synchronize data accesses. Use Core Data, SQLite, or Posix locks to help coordinate data access in a shared container.

    0 讨论(0)
提交回复
热议问题