Latest 0.1.0
Homepage https://github.com/adam-leitgeb/CoreDataAdapter
License MIT
Platforms ios 11.0
Frameworks Foundation, CoreData
Authors

A generic wrapper making work with CoreData easier. I took an inspiration to create this adapter while reading objc’s book: CoreData.

Example

// Model
final class Dog: NSManagedObject, Managed {
    @NSManaged var birthDate: Date
    @NSManaged var name: String
}

let coreDataAdapter = CoreDataAdapter()

// Fetching results
let dogs: [Dog] = coreDataAdapter.fetch()

// Creating objects
coreDataAdapter.createManagedObject(type: Flashcard.self) { dog in
    dog.birthDate = Date()
    dog.name = "Rex"
}

// Removing objects
let dogToDelete = dogs[0]
coreDataAdapter.deleteManagedObject(dogToDelete) {
    if let error = error {
        // error
    } else {
        // success
    }
}

To do

  • [ ] Edit objects
  • [ ] Better error handling

Requirements

  • Swift 4.2+
  • Xcode 10+

Installation

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

pod 'CoreDataAdapter'

License

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

Latest podspec

{
    "name": "CoreDataAdapter",
    "version": "0.1.0",
    "summary": "A generic wrapper making work with CoreData easier.",
    "description": "A generic wrapper making work with CoreData easier. I took an inspiration to create this adapter while reading objc's book: CoreData.",
    "homepage": "https://github.com/adam-leitgeb/CoreDataAdapter",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "adam-leitgeb": "[email protected]"
    },
    "source": {
        "git": "https://github.com/adam-leitgeb/CoreDataAdapter.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "11.0"
    },
    "swift_version": "4.2",
    "source_files": "Sources/**/*",
    "frameworks": [
        "Foundation",
        "CoreData"
    ]
}

Pin It on Pinterest

Share This