This blog post shows how Swift protocols can help using CoreData: http://martiancraft.com/blog/2015/07/objective-c-swift-core-data/
Following this advice, I have tried this technique, with success, but with a request for improvement.
Below you will find a bare minimal view of the API I'm working on. Notice the not nice Person.self
in the line db.fetchAll(Person.self, "SELECT * FROM persons")
. I want to improve that, and the linked blog post was a great deal of inspiration.
// Library
class RowModel {} // Equivalent of NSManagedObject in Core Data
class Database {