Latest 0.7
License MIT
Platforms ios 8.0, requires ARC
Dependencies SwiftyJSON, YapDatabase
Authors , ,

A wrapper for YapDatabase which can be used as a simple cache

This library is a wrapper for YapDatabase and exposed methods can be used to:

  • fetch one or more resources from a local database within a collection
  • persist resources into collections of a local database
  • remove a single or all resources from the local database

All resources must implement protocol CacheResourceSerializable:

  • all CacheResourceSerializable must expose an id: String property (get)
  • all CacheResourceSerializable must expose a dictionary: [String: AnyObject] property (get)
  • it is mandatory that resources conforming to CacheResourceSerializable protocol could be initialized with a [String: AnyObject] dictionary – the initializer is failable

CacheResourceSerializable protocol uses NMJSON module.
All "search-by-path queries" executed on json property of classes implementing CacheResourceSerializable
will use "." (dot) as queries’ path separator, unless other separators are specified: for example, a string value inside of a
CacheResourceSerializable compliant class could be found by calling <object>.json.string("<your.string.path>").

As of version 0.3.0, NMCache does not support queries.

Latest podspec

    "name": "NMCache",
    "version": "0.7",
    "summary": "Simple cache built on top of YapDatabase",
    "description": "A wrapper for YapDatabase which can be used as a simple cache",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Francesco Colleoni": "[email protected]",
        "Vincenzo Ferrara": "[email protected]",
        "Alex Corlatti": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.7"
    "source_files": [
    "platforms": {
        "ios": "8.0"
    "requires_arc": true,
    "dependencies": {
        "SwiftyJSON": [
            "~> 2.3"
        "YapDatabase": [
            "~> 2.9"

Pin It on Pinterest

Share This