Skip to content
Core Data made simple.
Branch: develop
Clone or download
Latest commit 8391b00 Jun 30, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
Source Bumped version and build numbers Jun 30, 2018


Language: Swift Platform License: MIT CocoaPods Apps Author: vmartinelli

A powerful and elegant Core Data framework for Swift.


Simple do that:

let query = persistentContainer.viewContext.people
    .where { \.city == "Piracicaba" }
    .orderBy { \.name }

for person in query.dropFirst(20).prefix(10) {
    print(, person.address)

Or that:

persistentContainer.performBackgroundTask { context in
    let query = context.people
        .filtered(using: \.country == "Brazil" && \.isContributor == true)
        .sorted(by: .descending(\.contributionCount))
        .sorted(by: \.name)

    if let person = query.first() {

After that:

import AlecrimCoreData

extension ManagedObjectContext {
    var people: Query<Person> { return Query(in: self) }

let persistentContainer = PersistentContainer()

And after your have created your matching managed object model in Xcode, of course. ;-)


In version 6 the framework was rewritten from scratch. AlecrimCoreData now uses key paths and it does not rely on generated (or written) custom attributes anymore. Also the ACDGen utility is no more. If your code depends on this, please use the previous versions.

Some well known features and functionalities may be reimplemented in a future release. No guarantees, though.


If you have any problems or need more information, please open an issue using the provided GitHub link.

You can also contribute by fixing errors or creating new features. When doing this, please submit your pull requests to this repository as I do not have much time to "hunt" forks for not submitted patches.

  • master - The production branch. Clone or fork this repository for the latest copy.
  • develop - The active development branch. Pull requests should be directed to this branch.

Contact the author


AlecrimCoreData is released under an MIT license. See LICENSE for more information.

You can’t perform that action at this time.