Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building your first iOS app with Hoodie

Building your first iOS app with Hoodie

Slides of the presentation at Cococoheads Berlin from 21.05.14 about how to build an offline first iOS app with Hoodie as Backend.

Katrin Apel

May 21, 2014
Tweet

More Decks by Katrin Apel

Other Decks in Technology

Transcript

  1. $ brew update! $ brew install git! $ brew install

    node! $ brew install couchdb! $ npm install -g hoodie-cli Install Hoodie & dependencies
  2. Create HOOHoodie instance #import “HOOHoodie.h" ! ! NSURL *baseURL =

    [[NSURL alloc] initWithString:@"http://localhost:6001/_api"]; ! self.hoodie = [[HOOHoodie alloc] initWithBaseURL:baseURL];
  3. Save data NSDictionary *newUnicorn = @{@"name": @"Primrose Rainbow Mane"}; !

    [self.hoodie.store saveObject:newUnicorn withType:@"unicorn" onSave: ^(NSDictionary *savedObject, NSError *error) { ! }];
  4. Retrieve data ! // Retrieve all objects of one type

    ! ! NSArray *unicorns = [self.hoodie.store findAllObjectsWithType:@"unicorn"]; ! ! // Retrieve object by id ! NSDictionary *myUnicorn = [self.hoodie.store findObjectWithID:@"unicorn/08858vp" andType:@"unicorn"];
  5. F U R T H E R R E S

    O U R C E S • Hoodie Website: http://hood.ie/ • HOOHoodie: https://github.com/kaalita/Hoodie-iOS • Plugin Tutorial: https://github.com/espy/hoodie-plugin-tutorial • Nodejitsu Deployment: https://github.com/hoodiehq/my-first- hoodie#deploy-to-nodejitsu • Hoodie Chat: irc.freenode.net/#hoodie ! • On Twitter: @hoodiehq Image Credit: Adventure Time: http://www.fanaru.com/adventure-time/image/14003/jake-reading-a-book-wallpaper/