Code Monkey home page Code Monkey logo

palettes's Introduction

Palettes

Palettes contains three NSIncrementalStore subclasses for loading data from various sources, including a local JSON file and a remote API endpoint. These stores are intended to be used independantly as examples for using Incremental Stores with Core Data.

Palettes is setup to work with data from the from the COLOURlovers API but the stores are simple enough to be adapted for other data formats. The JSON modeling is not central to the implementation.

Stores

LocalIncrementalStore provides the most basic building blocks and a disk based read-only Incremental Store.

RemoteIncrementalStore uses an API to provide JSON from a remote data source. This class can be without a Fetched Results Controller, and leverage NSAsynchronousFetchRequest for basic asynchronous request handling.

CachingIncrementalStore utilizes a second internal Core Data stack to serve requests from local cache while asynchronously updating from a remote data source. As remote objects are fetched, the local cache context is updated in addition to the main context. Using an NSFetchedResultsController is recommended for observing and responding to change notifications.

For more information, see the complete write up about Building an NSIncrementalStore.

Default Setup

Palettes is setup to use the CachingIncrementalStore by default. To change stores, modify the storeType passed into the NSPersistentStoreCoordinator, as it's initialized inside CoreDataManager.

Requirements

  • Xcode 13
  • Swift 5

License

The MIT License (MIT)

palettes.png

palettes's People

Contributors

andyshep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

palettes's Issues

String format specifier

Hi,

In CachingIncrementalStore.swift: what does %K string format specifier mean here?

let predicate = NSPredicate(format: "%K = %@", kPALResourceIdentifierAttributeName, refObj.description)

I can't find a mention of it in Apple's doc's.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.