Lens is a very simple yet elegant query builder made in Swift to work with CoreData.
- Chainable method calls
- Generics Support
- iOS 7.0+ / Mac OS X 10.9+
- Xcode 6.1
You can use CocoaPods to integrate Lens in your project. You can install it with the following command
$ gem install cocoapods
Update your Podfile
to use Lens
pod 'Lens'
Then, run the following command
$ pod install
lens(forEntity: Person.self, managedObjectContext).look();
lens(forEntity: Person.self, managedObjectContext).find(@"name").equals(@"John").look();
lens(forEntity: Person.self, managedObjectContext).find(@"name").equals(@"John").and(@"age").equals(26).look();
lens(forEntity: Person.self, inContext: managedObjectContext).sort("name", ascending: true).look();
Lens is a working in progress so feel free to fork this project and improve it!
Lens is released under the MIT license. See LICENSE for details.