0

I am writing an exercise app using Swift / Xcode which includes an uneditable database of exercises that will be accessed constantly. This database is composed of arrays and simple exercise objects. I would like to store this database within the app so it may be used offline and I can continue to use my current code, but I am open to other options.

Should I just create all 90 exercise objects and throw them in the same file as the database class? I have heard of SQLite but I am not sure it is what I need. What would be the simplest way to initialize the exercise objects and store them in the database?

Here is my Exercise Class Code , if it helps.

ece321
  • 3
  • 3
  • Store them as a text file inside your main bundle in json or plist format. Also post code as text and not as an image in your question. – Joakim Danielson Jul 08 '18 at 18:41

2 Answers2

0

IMO using Realm is by far the simplest solution to your problem. Since Realm is an object store, you will simply store the objects directly in a so-called Realm - in your case an object of type Exercise.

Caravan
  • 138
  • 2
  • 7
0

I figured out a good solution! I used SwiftPlistManager and learned to keep all my info in a plist. Thanks for the help!

ece321
  • 3
  • 3