![]() ![]() Wait, was the SQL query implicitly coerced from a String to UnsafePointer!?įollowing the tutorial at ZetCode, I started with the following C program that fetches the version of the SQLite engine and prints it to standard output: #include #include int main ( void ) sqlite3_finalize (res) sqlite3_close (db) exit ( 0 ) $ swift version2.swift 3.37.0 Since I have never really used SQLite before (except when I inadvertently initialized Rails projects without specifying the database engine), and since the Swift SQLite3 library is literally just sqlite.c with Swift typings, I decided to try the library out in C first.Īh, the joy of low-level compiled languages comes to full fruition in the Swift ecosystem, where some libraries are written in C, some in Objective-C, and some in Swift, and they all just call each other at random. Since the data needs to be serialized to XML, these types of storage only support primitive scalar values, such as strings, numbers, or booleans.įor more complex values, there is an API called Core Data, which is a wrapper over SQLite. Today I followed chapter 8 of the SwiftUI Apprentice tutorial.Īlthough a bit difficult to follow, the chapter described several data persistence APIs on Apple platforms, and taught how to use and APIs persist data in a space called “user defaults,” which is a wrapper for “property lists,” which in turn are basically XML files saved to the application’s sandboxed file storage (under Library/Preferences, IIRC). v Home Blog Contact Videos Résumé Learning iOS and Swift. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |