Search code examples
swiftxcodecore-data

pre-installed data in core data


I want to code an app in swift and xcode 7. Is there an opportunity to deliver data that are already stored in core data with the app? My goal is: When the customer downloads the app from the app store: the app should show a set of data.


Solution

  • You can store your data in JSON file which you'll include in bundle and on the first run, parse it and import to core data.

    Second way is to have prepopulated database as described here: https://stackoverflow.com/a/2233979/1495682 but, I don't recommend this approach.