Latest 0.1.1
Homepage https://github.com/tonyli508/ObjectStorage
License MIT
Platforms watchos 2.0, ios 8.0, osx 10.9, requires ARC
Authors

ObjectStorage

CocoaPods
Build Status

ObjectStorage is a framework that make CRUD works on your model entities, you may choose what storage you want e.g. Sqlite, CoreData, plist…

Current Support

  • [x] CoreData
  • [ ] Sqlite
  • [ ] UserDefaults
  • [ ] Keychains
  • [ ] File

How to use

Best thing to do is have a look at ObjectStorageTests.

  • Make your model conform to Model protocol, I suggest you create a base class for that, take a look at MappableModel in ObjectStorageTests folder.
    class UserProfile: Model

    Most import for CoreData is set up your ModelIdentifier in your model.

    public typealias ModelIdentifier = (modelName: String, keys: [String], values: [String?])

    modelName is the CoreData model name, keys and values will use for CoreData queries.

  • Create StorageProviderService instance
    let storageProvider = StorageProviderService(coreDataModelFileName: "Model")
  • Then CRUD your model
    storageProvider.create(UserProfile(firstName: 'Jiantang', lastName: 'Li'))

CocoaPods

ObjectStorage’s already taken, so I use ‘LiObjectStorage’ instead.

pod 'LiObjectStorage', '~> 0.1.1'

Carthage

github "tonyli508/ObjectStorage", "~> 0.1.1"

TODOs

  • Simplify Model Protocol.
  • More storage support.
  • Add more complex testings.
  • Carthage support.

Latest podspec

{
    "name": "LiObjectStorage",
    "version": "0.1.1",
    "license": "MIT",
    "summary": "ObjectStorage is a framework that make CURD works on your model entities",
    "homepage": "https://github.com/tonyli508/ObjectStorage",
    "authors": {
        "Li Jiantang": "[email protected]"
    },
    "social_media_url": "https://twitter.com/tonyli508",
    "source": {
        "git": "https://github.com/tonyli508/ObjectStorage.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "watchos": "2.0",
        "ios": "8.0",
        "osx": "10.9"
    },
    "requires_arc": "true",
    "source_files": [
        "ObjectStorage/ObjectStorage/*/*.swift",
        "ObjectStorage/ObjectStorage/*.swift"
    ]
}

Pin It on Pinterest

Share This