Tarjerw
Tarjerw

Reputation: 525

Storing large amounts of data persistently in Swift

I am currently making an app where I need to store large amounts of data persistently, much of which is contained within custom classes.

I am used to using UserDefault for storing data, but I have read that UserDefault doesn't work well with large amounts of data. What are my options, and is it possible to store it all by using UserDefault?

The game is a football manager game, and I have 30 teams, and every team has around 25 players, and every player has a long list of variables like games, goals, club etc that needs to be stored after each game

Upvotes: 1

Views: 2221

Answers (2)

Tiago Couto
Tiago Couto

Reputation: 351

I would recommend using Realm. It abstracts the complexity of working with SQLite and it is easier than Core Data.

https://realm.io/docs/swift/latest/

Upvotes: 2

Tom E
Tom E

Reputation: 1607

Please have a look at Core Data, an Apple framework which helps you do exactly this: store large amounts of data persistently. Apple has loads of documentation. You might want to start here:

Core Data Programming Guide

Upvotes: 2

Related Questions