Latest 0.2.6
License MIT
Platforms ios 10.0

CI Status


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


Dictionaries <> Core Data

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

Written 100% purely in Swift 4

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")


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


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


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")


Timothy S Bowers, [email protected]


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

Latest podspec

    "name": "PersistenceEngine",
    "version": "0.2.6",
    "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 4nnEasily 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": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Timothy S Bowers": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.2.6"
    "platforms": {
        "ios": "10.0"
    "source_files": "PersistenceEngine/Classes/**/*"

Pin It on Pinterest

Share This