I am working with SQLite.swift. In the document, the database path:
let path = NSSearchPathForDirectoriesInDomains(
.DocumentDirectory, .UserDomainMask, true
).first!
but I want to import and use an existing database, so I dragged my existing database into the keyboard extension folder and create a connection to it using the path:
let path = NSBundle.mainBundle().pathForResource("db", ofType:"sqlite3")
So, I noticed that the first way, the database will be stored in /Users/*/Library/Developer/CoreSimulator/Devices/8B1DB861-AA3F-446F-A559-D4727CDB9285/data/Containers/Data/PluginKitPlugin/0BC647E4-26F3-4A1F-8271-CC73C96FD197/Documents
and the second way, the database will be stored in the application.
/Users/*/Library/Developer/CoreSimulator/Devices/8B1DB861-AA3F-446F-A559-D4727CDB9285/data/Containers/Bundle/Application/E5D9514C-859A-4D4D-A771-A8CE9CDCD3E7/AppName.app/PlugIns/AppNameExt.appex
How are these two locations different? The second way can increase the size of the application because it contains a database? And if I want to archive / submit my application to the AppStore with an existing database, is this the only way?
source
share