Latest 0.3
Homepage https://github.com/lourenco-marinho/Lens
License MIT
Platforms ios 7.0, requires ARC
Authors

Lens

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

Features

  • [x] Chainable method calls
  • [x] 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.

Latest podspec

{
    "name": "Lens",
    "version": "0.3",
    "summary": "Lens is a very simple yet elegant query builder made in Swift to work with CoreData.",
    "homepage": "https://github.com/lourenco-marinho/Lens",
    "license": "MIT",
    "authors": {
        "Lourenu00e7o Marinho": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lourenco-marinho/Lens.git",
        "tag": "0.3"
    },
    "social_media_url": "https://twitter.com/lopima",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Source/*.swift"
}

Pin It on Pinterest

Share This