WWDC23 SALE: Save 50% on all my Swift books and bundles! >>

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.


Save 50% in my WWDC23 sale.

SAVE 50% To celebrate WWDC23, all our books and bundles are half price, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.

Save 50% on all our books and bundles!

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.