# How to Preload and Import Existing Data

**URL:** <https://forums.kodeco.com/t/how-to-preload-and-import-existing-data/128197>\
**Category:** Core Data by Tutorials\
**Created:** [December 21, 2020, 7:38pm UTC](https://forums.kodeco.com/t/how-to-preload-and-import-existing-data/128197 "2020-12-21T19:38:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmalicke](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dmalicke/32/81494_2.png) [@dmalicke](https://forums.kodeco.com/u/dmalicke)\
**Post date:** [December 21, 2020, 7:38pm UTC](https://forums.kodeco.com/t/how-to-preload-and-import-existing-data/128197/1 "2020-12-21T19:38:24Z")

</div>

Hello!

I’m looking for a simple example detailing how to import data (from JSON or anything else) into the Swift 5, iOS 14, Xcode 12 Core Data.

I’m trying to hack together something by copying/pasting from [https://www.raywenderlich.com/14958063-modern-efficient-core-data](https://www.raywenderlich.com/14958063-modern-efficient-core-data) … but there are several pieces from this project that I think are beyond what I need. For example the persistence.swift file is a class rather than a struct, and there are changes to the @Main file which I don’t think are necessary for my case. If possible, I’d like to keep the boiler plate @Main file and the boiler plate persistence.swift file that are added when I select Core Data when I’m first creating the project.

Basically just importing data from:  
let jsonURL = Bundle.main.url(forResource: “seed”, withExtension: “json”)!

and mapping to core data.

rather than using all the combine stuff in the linked example above.

Any pointers you can provide are greatly appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [June 6, 2021, 11:38am UTC](https://forums.kodeco.com/t/how-to-preload-and-import-existing-data/128197/2 "2021-06-06T11:38:25Z")

</div>

Closed on June 6, 2021, 11:38am UTC

This topic was automatically closed after 166 days. New replies are no longer allowed.
