You can safely ignore this since the database file self-destructs each time the playground runs. You might also see a destroyPart1Database() call at the top of the page. This means it will only execute when you explicitly invoke the execution by clicking the Play button. Long-click the Play button at the bottom and notice that your playground runs manually instead of automatically: This binary contains all the functionality for the SQLite code you’ll write in this tutorial. Note: The project is in an Xcode workspace because it uses the SQLite3 dependency as an embedded binary. This will give you a basic understanding of how underlying frameworks work within a wrapper. :]įinally, you’ll briefly learn about the popular open-source Swift wrapper SQLite.swift. This will let you write abstraction APIs for your apps and avoid working with the more complicated SQLite C APIs. In this SQLite with Swift tutorial, you’ll learn how to perform the following database operations:Īfter learning how to perform these fundamental operations, you’ll see how to wrap them in a Swift-like manner. Core Data is just a layer on top of SQLite that provides a more convenient API. In fact, if you’ve used Core Data before, you’ve already used SQLite. But how do you store those structures efficiently?įortunately, some great minds have developed solutions for storing structured data in databases and writing language features to access that data. Often, this comes in the form of data structures. In software development, it doesn’t take long before you need to persist app data. Update note: Adam Rush updated this tutorial to Xcode 11, iOS 13 and Swift 5.
0 Comments
Leave a Reply. |