Mr T
Mr T

Reputation: 1000

iOS Swift App - Database

I'm learning Swift & am able to construct a basic app. I have an app in mind as the end goal that will allow users to log in, answer questions (which are constantly being added to by me & record their results.

This is obviously going to require a database of some form hosted & accessible online. My thoughts are that this would be done using something like a MySQL Db (like website databases), but is this the best & generally accepted way of doing things?

Upvotes: 4

Views: 5228

Answers (2)

pteofil
pteofil

Reputation: 4163

Apple provides Core Data framework to work with databases on iOS.

There are other options too, but I prefer Realm. It' very easy to learn and use. Here's a tutorial for it.

Upvotes: 1

Miknash
Miknash

Reputation: 7948

If you want to host it somewhere on the web, I think that the best solution would be to create REST API ( you can write that in any language, I will name few: Rails, C#, Java, PHP, Python ). I think that in general it is a bad practice to have direct calls to remote database within your swift app.

If you want local database for users you could use SQLite, Core Data, Realm and other similar tools.

To have everything covered you could create some kind of database as a service and use that one instead of REST API. That would be Parse, Firebase etc. These services are free for start, but expensive as you expand your requirements.

Upvotes: 5

Related Questions