You can do database programming by Core Data, O/R mapping tool for Sqlite, on iOS.
Environment: Xcode 8.3, Swift 3
At first, Check "Use Core Data" when project is created.
And code of Core Data Objects are created in AppDelegate.
Next, select "[project name].xcdatamodeld" and define table layout.
To save UIImage, select "Binary Data" in Type and check "Allow External Storage".
When the size of UIImage is big, URL of UIImage is saved in Core Data.
When you don't check "Allow External Storage", the time of saving core data will take and memory utilization will be increase instantly, and an application will crash.
After table layout definition, execute [Editor]-[Create NSManagedObject Subclass] on Xcode.
And class of table layout definition, NSManagedObject is created.
At last, declare "import Core Data" at the top of class using Core Data.
2.How to INSERT
At first, Make NSManagedObjectContext in AppDelegate.
Next, Make NSManagedObject from NSManagedObjectContext.
Let's see code for inserting new data by Core Data.
2.How to SELECT
Let's see code for selecting data by Core Data.
Use NSPredicate for designating searching options.
Use NSSortDescriptor and ascending option for designation sort options.
If you road UIImage, check UIImageOrientation.
If UIImageOrientation is down, you must invert UIImage.
3.How to UPDATE
Update value of data which is read.
Let's see code for updating data by Core Data.
4.How to DELETE
Delete data which is read.