Latest 1.0.0
Homepage https://github.com/johnfairh/TMLPersistentContainer
License ISC
Platforms ios 10.0, osx 10.12, watchos 3.0, tvos 10.0
Frameworks Foundation, CoreData
Authors

Automatic shortest-path multi-step Core Data migrations in Swift.

logo

A Swift extension to Core Data’s NSPersistentContainer that automatically
detects and performs multi-step store migration using the shortest valid
sequence of migrations. The library supports both light-weight and
heavy-weight migrations, multiple stores, progress reporting, and configurable
logging.

Example

Minimally replace the call to NSPersistentContainer.init:

container = PersistentContainer(name: "MyStore",
                                managedObjectModel: model)

Additional parameters optionally enable more features:

container = PersistentContainer(name: "MyStore",
                                managedObjectModel: model,
                                bundles: [Bundle.main, myResBundle],
                                modelVersionOrder: .list("V_One", "V_Two", "V_Six"),
                                logMessageHandler: myLogHandler)
container.migrationDelegate = self

All migrations happen as part of NSPersistentContainer.loadPersistentStores.

Documentation

Requirements

Swift 3.

The library is based on NSPersistentContainer so requires a minimum
deployment target of iOS 10.0, macOS 10.12, tvOS 10.0, or watchOS 3.0.

No additional software dependencies.

Installation

CocoaPods:

use_frameworks!
pod 'TMLPersistentContainer'

Swift package manager:

.Package(url: "https://github.com/johnfairh/TMLPersistentContainer/", majorVersion: 1)

Contributions

Contributions and feedback welcome – open an issue / [email protected]

License

Distributed under the ISC license.

Latest podspec

{
    "name": "TMLPersistentContainer",
    "version": "1.0.0",
    "authors": {
        "John Fairhurst": "[email protected]"
    },
    "license": {
        "type": "ISC",
        "file": "LICENSE"
    },
    "homepage": "https://github.com/johnfairh/TMLPersistentContainer",
    "source": {
        "git": "https://github.com/johnfairh/TMLPersistentContainer.git",
        "tag": "1.0.0"
    },
    "summary": "Automatic shortest-path multi-step Core Data migrations in Swift.",
    "description": "A Swift extension to Core Data's NSPersistentContainernthat automatically detects and performs multi-step storenmigration using the shortested valid sequence.  Supportsnlight-weight and heavy-weight migrations, multiple stores,nprogress reporting and configurable logging.",
    "documentation_url": "https://johnfairh.github.io/TMLPersistentContainer/",
    "platforms": {
        "ios": "10.0",
        "osx": "10.12",
        "watchos": "3.0",
        "tvos": "10.0"
    },
    "source_files": "Sources/*swift",
    "frameworks": [
        "Foundation",
        "CoreData"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This