Before starting to code, you must add a specific library for SQLite. Within Xcode, ensure that the General tab is selected and visible. At the end of the page, look out for the Linked Frameworks and Libraries section. View and click on the icon with the plus sign, as shown in the following screenshot:
A modal window will appear; please enter the word sqlite
, and from the list of information, select the libsqlite3.dylib option, as shown in the following screenshot:
After selecting it, click on the Add button to move forward.
As part of this chapter, we will use
FMDB and an Objective-C wrapper around SQLite to show the database SQLite with Swift. FMDB stands for Flying Meat Database, and it easily interacts with SQLite and actually saves time and effort. For example, the FMDB will be linked to one SQLite database and will be there for the execution of SQL queries. The output is FMResultsSet
, which shows results for queries executed on the FMDB.