How do I share a sqlite database from my iOS project to my WatchKit Extension?

209 views Asked by At

How do I share a sqlite database from my iOS project to my WatchKit Extension using MMWormhole in objc?

1

There are 1 answers

0
Adrian Schönig On

MMWormhole is meant for passing individual messages and snippets of data between your app and an extension; it does not cover your use case of sharing an entire SQLite database.

In watch OS 1 you can put the SQLite database into a shared container.

In watch OS 2 this isn't possible anymore as the extension is running in a different device. You could transfer the file using WCSession, but you might want to rethink your architecture so that sending small messages between the phone and watch is sufficient rather than transmitting the full SQLite database.