Tom G
Tom G

Reputation: 133

How to access my existing SQLite database in swift 3

I have a small database in SQLite (1 table, 3 columns, 61 rows) and I want to present it in the app inside a Tableview for read only.

I'v already imported FMDB and created the bridging-header but i have no idea where to go from here. My database sit in my server so if that cause any problem i don't mind to embed it in the app. I need to know how to get the app to recognize the database and how to get the data from the database.

If someone could guide me to the right way or refer me to a step-by-step tutorial that would be highly appreciate and a great help. Thank you all.

Upvotes: 2

Views: 619

Answers (1)

Nikita Patskov
Nikita Patskov

Reputation: 457

If this database is immutable, best solution is put it to the app resources. But if u want to change data u should use HTTP requests to get data. You must teach your server recognize that requests from user devices. Look that: Server-side 1) HTTP protocols 2) JSON (JSON rpc) 2) PHP/Python

Client-side: 1) URL requests 2) JSON libraries (Swifty JSON, etc.)

Upvotes: 1

Related Questions