This is a side project I've been working on for the last few weeks.
It's a small swift app that will turn into a game sometime soon (hopefully).
In this app, I've used CoreData to persist player information and game state.
When working with RubyOnRails' ActiveRecord in the past, I found Query Interface to be very developer friendly and intuitive. It allows application to be concerned with the logic and not have to deal with all the mechanics of fetching the data.
I've implemented a similar interface in my app. I created a "Query" interface encapsulating CoreData calls and exposing a simplified Query API to the rest of the app.
Some examples:
// fetching multiple rows
let people = Query("Person").whereEqual( "lastName", lastName ).sort( "name" ).fetch()
// finding a person by ID
if let person = Query("Person").whereEqual( "personId", personId ).fetchFirst() as Person? { ... do something ... }
// Managed objects example:
Assuming State is a CoreData Entity that has a single row per Person:
let person = Person.find( 10 )
let state = State.findOrCreateBy( person )
Here's a gist I created that describes this approach.