Latest 0.2.5
Homepage https://github.com/timothybowers/PersistenceEngine
License MIT
Platforms ios 10.0
Authors

CI Status
Version
License
Platform

PersistenceEngine

PersistenceEngine is built and maintained with ❤️ by Timothy S Bowers.

About

Dictionaries <> Core Data

Making life easier to save and manage Dictionaries into Core Data for persistence.

Written 100% purely in Swift 3.0

Easily store your dictionaries in Core data using simple commands like:

coreDataStore.insert(dictionary: myDict1, intoEntity: "TestEntity1")

And read your dictionaries from Core Data using:

let myNewDictArray = coreDataStore.dictionaryFrom(entity: "TestEntity1")

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 8.0+
  • iOS 10.0+
  • Interoperability with Swift 3.0+

Installation

PersistenceEngine is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "PersistenceEngine"

Quick-start Instructions

Step 1: Create a new file, of type: Data Model (Core Data) in your application folder (Main Bundle) and save it with the name PersistenceEngineDB.xcdatamodeld

Step 2: Open this new file and create a new entity with any name you like (Starting with a capital), e.g. AirportsEntity

Step 3: Create an attribute with the name coredictionary (all small letters) for each entity you add. Type must be Transformable

Step 4: Add import statement:

import PersistenceEngine

Quick example usage:

Step 5: Initialise a new instance of PersistenceEngine:

let store = PersistenceEngine()

Step 6: Create a dictionary:

let airportsDictionary: [String: Any] = ["YYZ": "Toronto Pearson", "DUB": "Dublin"]

Step 7: Save the dictionary to core data: (Note: you can insert multiple dictionaries here into the same Entity)

store.insert(dictionary: airportsDictionary, intoEntity: "AirportsEntity")

Step 8: Load the dictionary from core data: (Note: you will receive an ARRAY of dictionaries here)

let restoredDictionaryArray = store.dictionaryFrom(entity: "AirportsEntity")

Author

Timothy S Bowers, [email protected]

License

PersistenceEngine is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "PersistenceEngine",
    "version": "0.2.5",
    "summary": "Making life easier to manage and save Dictionaries & Structs into Core Data for persistence.",
    "description": "Dictionaries <> Core DatannMaking life easier to manage and save Dictionaries & Structs into Core Data for persistence.nnWritten 100% purely in Swift 3.0nnEasily store your dictionaries & structs in Core data using simple commands like:n`persistenceStore.insert(dictionary: myDict1, intoEntity: "TestEntity1")`nnAnd read your dictionaries from Core Data using:n`let myNewDictArray = persistenceStore.dictionaryFrom(entity: "TestEntity1")`nnExample code will show you how to save any struct into a dictionary automatically and recursively.",
    "homepage": "https://github.com/timothybowers/PersistenceEngine",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Timothy S Bowers": "[email protected]"
    },
    "source": {
        "git": "https://github.com/timothybowers/PersistenceEngine.git",
        "tag": "0.2.5"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "PersistenceEngine/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This