Go to file
Vanderlei Martinelli 4571d32159 Merge branch 'release/7.0-beta.2' 2020-02-11 18:49:26 -03:00
AlecrimCoreData.xcodeproj Minor Xcode project file changes 2019-04-13 04:55:34 -03:00
Sources Fix `dropFirst` and `prefix` 2020-02-11 18:48:23 -03:00
Supporting Files Initial version 7.0 commit 2019-04-13 01:53:49 -03:00
Tests Initial version 7.0 commit 2019-04-13 01:53:49 -03:00
.gitignore Initial version 7.0 commit 2019-04-13 01:53:49 -03:00
AlecrimCoreData.png Initial version 7.0 commit 2019-04-13 01:53:49 -03:00
AlecrimCoreData.podspec Initial version 7.0 commit 2019-04-13 01:53:49 -03:00
CHANGELOG.md Updated CHANGELOG 2019-04-13 02:08:10 -03:00
LICENSE Initial version 7.0 commit 2019-04-13 01:53:49 -03:00
Package.swift Initial version 7.0 commit 2019-04-13 01:53:49 -03:00
README.md Initial version 7.0 commit 2019-04-13 01:53:49 -03:00

README.md

AlecrimCoreData

Version Language: swift Platforms License: MIT Author: Vanderlei Martinelli

A powerful and elegant Core Data framework for Swift.

Usage

Beta version. New docs soon...

Simple do that:

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

for person in query.dropFirst(20).prefix(10) {
    print(person.name, 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() {
        print(person.name, person.email)
    }
}

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. ;-)

Contribute

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

License

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