Search code examples
iosobjective-cuiimagewatchkitwkinterfaceimage

There is no way to transfer an UIImage from iPhone to WKInterfaceImage in the WatchKit app, correct?


There is no way to transfer an UIImage from iPhone to WKInterfaceImage in the WatchKit app, correct?

There are limitations that will not allow that, correct?

Then I tried saving it in the documents folder on the device. But those are 2 seperate folders on each device, correct? The iPhone has a documents folder. And the one on the Watch device is a separate one. So when I query the file path, it gives me something like Device/pluginKit/filename.png on the Watch.

In short there is no way to achieve the above title, right?


Solution

  • If you want to share disk space/files between your host iOS app and your WatchKit extension, you'll need to use App Groups. Check out the documentation here: https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/DesigningaWatchKitApp.html ("Sharing Data with Your Containing iOS App")

    WKInterfaceImage, however, has a couple methods for using an image from the phone. I've put together a quick explanation here: http://www.fiveminutewatchkit.com/blog/2015/3/10/how-to-display-an-image-using-wkinterfaceimage