Giter VIP home page Giter VIP logo

parcelkit's Introduction

ParcelKit

ParcelKit integrates Core Data with Dropbox using the Dropbox Datastore API.

Installation

ParcelKit can be added to a project using CocoaPods. We also distribute a framework build.

Using CocoaPods

// Podfile
pod 'ParcelKit'

and

pod install

Framework

  1. Open the ParcelKit.xcodeproj project
  2. Select the “Framework” scheme
  3. Build (⌘B) the Framework
  4. Open the Products section in Xcode, right click “libParcelKit.a”, and select “Show in Finder”
  5. Drag and drop the “ParcelKit.framework” folder into your iPhone/iPad project
  6. Edit your build settings and add -ObjC to “Other Linker Flags”

Usage

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;

Set up Core Data

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.

Documentation

Example Application

  • Toado - Simple task manager demonstrating the integration of Core Data and Dropbox using ParcelKit.

ToDo

  • Add support for the NSData attribute type

Requirements

  • iOS 6.1 or higher
  • Dropbox Sync SDK 2.0.0-b7 or higher
  • Xcode 4.6 or higher for building the framework
  • Xcode 5 Developer or higher for running the included logic tests

License

MIT.

parcelkit's People

Contributors

daikini avatar

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.