ParcelKit integrates Core Data with Dropbox using the Dropbox Datastore API
ParcelKit integrates Core Data with Dropbox using the Dropbox Datastore API.
ParcelKit can be added to a project using CocoaPods. We also distribute a framework build.
// Podfile
pod 'ParcelKit', '~> 2.1'
and
pod install
-ObjC
to “Other Linker Flags”Include ParcelKit in your application.
#import <ParcelKit/ParcelKit.h>
Initialize an instance of the ParcelKit sync manager with the Core Data managed object context and the Dropbox data store that
should be used for listening for changes from and writing changes to.
PKSyncManager *syncManager = [[PKSyncManager alloc] initWithManagedObjectContext:self.managedObjectContext datastore:self.datastore];
Associate the Core Data entity names with the corresponding Dropbox data store tables.
[syncManager setTable:@"books" forEntityName:@"Book"];
Start observing changes from Core Data and Dropbox.
[syncManager startObserving];
Hold on to the sync manager reference.
self.syncManager = syncManager;
ParcelKit requires an extra attribute inside your Core Data model.
Make sure you add this attribute to each entity you wish to sync.
An alternative attribute name may be specifed by changing the syncAttributeName property on the sync manager object.
MIT.