Skip to content

andyshep/Palettes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

iOS demo app for NSIncrementalStore

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages