SQLite: Local Database | Swift 4, Xcode 9

preview_player
Показать описание
Today we go over how to save data to a local database with SQLite using Swift 4. This tutorial will go over the basics of using SQLite in your iOS app so you can store user data. By the end of this tutorial, you will know how to create, read, update, and delete from your local database.

When you need to persist information into a database on a user’s device, SQLite can be a very powerful tool. As opposed to Core Data, SQLite is an actual database, whereas Core Data is a framework that manages an object graph. Adding a performant framework for storing data that a developer can manage is an invaluable tool that you can add to your arsenal.

See what's next on the schedule by checking out my Trello board:

If you want to live chat, join the Applied Swift Slack team by sending me your email address.

The finished project will be posted up on github which you can find the link here:

If you have any questions or comments about the tutorial, or want to suggest a video to make, feel free to leave a comment below, or reach out to me on Twitter:

If you found this tutorial helpful, make sure to subscribe to the channel for more great tutorials.
Рекомендации по теме
Комментарии
Автор

Thanks a lot for this video. It is not complicated, but for me who is dyslexic, it helps me a looot! Your video is very clean, you explain perfectly, thanks!

VueAutrement
Автор

I did everything same as you did but ı am getting error which is says cannot find type connection

connectciomer
Автор

Man, you made my day! since long i have been unable to understand the document path. I have used it a lot of times, but what actually is, now i understood, Cheers

chaudhryumair
Автор

Thank you from Russia, Kilo! This video was very helpful for me.

LexoneRUS
Автор

If possible, can you please explain regarding Migrating Locally saved SQLite DB when new version pushed to AppStore?

mannambrahmam
Автор

idk if its an error but i havent found info about it, if you filter for an id that doesnt exist it doesnt enter the catch, i printed the "user" object after the filter and it says that is a SQLite.Table... how can you control that?

sohkka
Автор

Hey Kyle it's a great video but could u make a video where you can display the data which u stored in ur data base on a table view ...it would be really helpful

prateekkushalappa
Автор

Thanks so much. I have been dreading learning SQL. But you made it simple and easy to understand. Keep up great tutorials

bykristopherson
Автор

Why do you use an ORM? Why not use regular code to query database?

lukeav
Автор

Could u tell me how u can show the list of data in the simulator only?

prateekkushalappa
Автор

Very well and relaxed explained. Thumbs up!

cruzadete
Автор

Does anyone know if the table/database breaks if you want to add a new column value AFTER the table has been created? Or should I just make a new table and "sql-join" it or something?

canzino
Автор

amazing video, easy to understand and follow (and im a beginner learning at home). i thought you were going to put the list of the users in an alert too at some point, but i guess that'll be my homework for sunday, just hope i can do it on my own.

mmcanhaoable
Автор

How we can print the listed users on the app instead of debug area?

movietrailers
Автор

Hi bro can we achieve multi threading with sqlite

javedsiddique
Автор

Hello, I am new to iOS development. Is it possible to use existing SQLite database? The app I am building has about 20+ tables, 8 col each table, and about 70 rows per table. Does this mean I need to program the creation of DB and table, and then the insertion of data on first open of App? Thanks for taking time commenting on my inquiry.

joemarecaro
Автор

thank you so much for this video. It explains exactly what I needed

daveh.
Автор

This video is incredibly easy to understand, and you covered a lot of great info. I was wondering how you would read data to check if info exists (such as checking if there are any user id's), and if so, do something with the data. (Insert data into a table view, make a label list the users, etc.) Keep up the great videos!

tesserakt
Автор

Thank you Veery much!!! It worked for ME Thank YOU!! vEERy good

eeddeellwweeiiss
Автор

Hello. thanks for your great tutorials. Recently I've used SQLite for my project. I have a difficulty to implement REGXP Search in SQLite. is there any method for that?

freebird