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.0'
and
pod install
- Open the ParcelKit.xcodeproj project
- Select the “Framework” scheme
- Build (⌘B) the Framework
- Open the Products section in Xcode, right click “libParcelKit.a”, and select “Show in Finder”
- Drag and drop the “ParcelKit.framework” folder into your iPhone/iPad project
- Edit your build settings and add
-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.
- syncID with the type String. The Indexed property should also be checked.
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.
- ParcelKit Reference documentation
- Toado - Simple task manager demonstrating the integration of Core Data and Dropbox using ParcelKit.
- iOS 6.1 or higher
- Dropbox Sync SDK 3.0.2 or higher
- Xcode 5 or higher
MIT.