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.

23e1eeb1ce09429cbb13a3c40d508626?s=128

Katrin Apel

May 21, 2014
Tweet

Transcript

  1. 10.

    $ brew update! $ brew install git! $ brew install

    node! $ brew install couchdb! $ npm install -g hoodie-cli Install Hoodie & dependencies
  2. 13.

    Create HOOHoodie instance #import “HOOHoodie.h" ! ! NSURL *baseURL =

    [[NSURL alloc] initWithString:@"http://localhost:6001/_api"]; ! self.hoodie = [[HOOHoodie alloc] initWithBaseURL:baseURL];
  3. 16.

    Save data NSDictionary *newUnicorn = @{@"name": @"Primrose Rainbow Mane"}; !

    [self.hoodie.store saveObject:newUnicorn withType:@"unicorn" onSave: ^(NSDictionary *savedObject, NSError *error) { ! }];
  4. 17.

    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. 27.

    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/