I know that we can get data from NSFileManager
to get images from our app into our WatchKit extension - but we've been using NSCache
to cache images in our iOS app. Is there a way to connect our WatchKit extension to images from NSCache
?
Here's what Apple's documentation says:
At runtime, you share files between processes by reading and writing those files in the shared container directory. To access the container directory, use the containerURLForSecurityApplicationGroupIdentifier: method of NSFileManager to retrieve the base URL for the directory. Use the provided URL to enumerate the directory contents or create new URLs for files in the directory.
To share preferences data between apps, create an NSUserDefaults object using the identifier of the shared group. The initWithSuiteName: method of NSUserDefaults creates an object that allows access to the shared user defaults data. Both processes can access this data and write changes to it.
At first glance, it sounds like no, it's not possible to use NSCache
to share images between our iOS app and our WatchKit app - but if somebody's got a way to do this, I'd love to know.