Skip to content

Lens is a very simple yet elegant query builder made in Swift to work with CoreData.

License

Notifications You must be signed in to change notification settings

lourenco-marinho/Lens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lens

Lens is a very simple yet elegant query builder made in Swift to work with CoreData.

Features

  • Chainable method calls
  • Generics Support

Requirements

  • iOS 7.0+ / Mac OS X 10.9+
  • Xcode 6.1

Installation

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

Usage

Query all objects from a single entity

lens(forEntity: Person.self, managedObjectContext).look();

Query entities based on their properties.

lens(forEntity: Person.self, managedObjectContext).find(@"name").equals(@"John").look();

Compound your queries.

lens(forEntity: Person.self, managedObjectContext).find(@"name").equals(@"John").and(@"age").equals(26).look();

Sort your results

lens(forEntity: Person.self, inContext: managedObjectContext).sort("name", ascending: true).look();

Who to blame

More

Lens is a working in progress so feel free to fork this project and improve it!

License

Lens is released under the MIT license. See LICENSE for details.

About

Lens is a very simple yet elegant query builder made in Swift to work with CoreData.

Resources

License

Stars

Watchers

Forks

Packages

No packages published