codescholar
codescholar

Reputation: 3

How to store a large array of strings

This is my second week learning swift.

Currently, I am trying to create a quote app that generates random quotes. I am storing the quotes in an array. So far the app works well, however, I don't think it's efficient to store the quotes in the view controller file, especially if I am planning on listing 100+ quotes. I came across a comment somewhere suggesting storing a large array of strings in a database or a plist file. I just want to know if someone could suggest the best way to store quotes in a database or something. Any help would be appreciated.

Upvotes: 0

Views: 2062

Answers (3)

kd02
kd02

Reputation: 430

Instead of doing it in a plist I would really reccommed using Realm Database.

It's a lot easier to setup than CoreData and provides the same functionality, loads of examples and documentation as well.

Upvotes: 0

Ilya Kharabet
Ilya Kharabet

Reputation: 4621

If you want to store quotes and nothing more, than database or UserDefaults will not be a good choice.

It will be better if you save quotes in plist file or JSON file.

Upvotes: 1

Related Questions