Latest 1.0
Homepage https://github.com/fastred/SingleFetchedResultController
License MIT
Platforms ios 8.0, osx 10.9
Frameworks CoreData
Authors

SingleFetchedResultController

Like NSFetchedResultsController but for a single managed object. Please see the associated blogpost.

Usage

class MyClass {
    var frc: SingleFetchedResultController<Profile>?
    ...

    func setup() throws {
        let predicate = NSPredicate(format: "username = %@", username)
        frc = SingleFetchedResultController(predicate: predicate,
                                            managedObjectContext: moc,
                                            onChange: { (profile, changeType) in
            // will be called after the first fetch and after each change to the object
            print(profile.username)
        })

        try frc?.performFetch()
    }
}

Requirements

iOS 8 and above.

Author

Arkadiusz Holko:

Latest podspec

{
    "name": "SingleFRC",
    "version": "1.0",
    "summary": "Like NSFetchedResultsController but for a single managed object.",
    "homepage": "https://github.com/fastred/SingleFetchedResultController",
    "license": "MIT",
    "authors": {
        "Arkadiusz Holko": "[email protected]"
    },
    "social_media_url": "https://twitter.com/arekholko",
    "source": {
        "git": "https://github.com/fastred/SingleFetchedResultController.git",
        "tag": "1.0"
    },
    "frameworks": "CoreData",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "source_files": "Framework/*.swift"
}

Pin It on Pinterest

Share This