TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Using CoreData for a reference guide, and if so, how to preload the data?

Forums > Swift

Hi everyone, I'm looking to build an app that basically will take an existing game reference guide and make it searchable in an app. The reference guide is a very straightforward list of words and their definitions. From the user's point of view it will be read only. Is this a good candidate for a CoreData database? If it is, what's the best way to preload the data into the database the first time the user opens the app?

The data itself is in a text file which will be in the app package (it won't need to be changed dynamically) and I'll be using delimiters to split the text into the name and definition columns.

Thanks, Alistair


I don't have an answer, but this is something I've been curious about for a while and would like to be notified of any responses. :D


I am fairly new and learning so please take that into account with my answer...

Is there a reason you want to use Core Data? From your explanation, and my limited knowledge, it seems like the juice isn't worth the squeeze.

To me, you should just leave this in a dictionary as part of your app instead of trying to push it into Core Data. Then you should be able to use .contains or another method if the user wants to search.

I also watched Paul's HWS Live yesterday and he showed off a Searchable feature that adds a search bar in a list. I haven't played with this yet but it may be something you wish to use. For example, if everything is in a String, String dictionary, you could list the word and definition in a list and search thru it.

I hope this makes sense. If I missed the boat, I apologize. So many have helped me on this forum and I am just trying to use my limited knowledge to give back some.


I was wondering if I was perhaps overdoing it by using CoreData. As you said, it may be better to go with a more straightforward approach.

Appreciate the input!


For what it's worth, I'm fairly certain this (prepopulated coredata) is the approach several apps take with similar featuresets (reference material).

Even if coredata is overkill, it's probably a great learning opportunity.


Hacking with Swift is sponsored by Superwall.

SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.

Learn More

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

Unknown user

You are not logged in

Log in or create account

Link copied to your pasteboard.