Latest blog entries

Erlang and Elixir Factory Lite B.A.

A brief introduction about what was the Erlang Factory Conference in Buenos Aires for some Inaka team members

Jul 07 2017 : Euen Lopez

The Art of Writing a Blogpost

The Art of Writing a Blogpost

Apr 11 2017 : Matias Vera

SpellingCI: No more spelling mistakes in your markdown flies!

Feb 14 2017 : Felipe Ripoll

Fast reverse geocoding with offline-geocoder

Do you need a blazing fast reverse geocoder? Enter offline-geocoder!

Jan 18 2017 : Roberto Romero

Using Jayme to connect to the new MongooseIM REST services

MongooseIM has RESTful services!! Here I show how you can use them in an iOS application.

Dec 13 2016 : Sergio Abraham

20 Questions, or Maybe a Few More

20 Questions, or Maybe a Few More

Nov 16 2016 : Stephanie Goldner

The Power of Meeting People

Because conferences and meetups are not just about the technical stuff.

Nov 01 2016 : Pablo Villar

Finding the right partner for your app build

Sharing some light on how it is to partner with us.

Oct 27 2016 : Inaka

Just Play my Sound

How to easily play a sound in Android

Oct 25 2016 : Giaquinta Emiliano

Opening our Guidelines to the World

We're publishing our work guidelines for the world to see.

Oct 13 2016 : Brujo Benavides

Using NIFs: the easy way

Using niffy to simplify working with NIFs on Erlang

Oct 05 2016 : Hernan Rivas Acosta

Function Naming In Swift 3

How to write clear function signatures, yet expressive, while following Swift 3 API design guidelines.

Sep 16 2016 : Pablo Villar

Jenkins automated tests for Rails

How to automatically trigger rails tests with a Jenkins job

Sep 14 2016 : Demian Sciessere

Erlang REST Server Stack

A description of our usual stack for building REST servers in Erlang

Sep 06 2016 : Brujo Benavides

Replacing JSON when talking to Erlang

Using Erlang's External Term Format

Aug 17 2016 : Hernan Rivas Acosta

Gadget + Lewis = Android Lint CI

Integrating our Android linter with Github's pull requests

Aug 04 2016 : Fernando Ramirez and Euen Lopez

Passwordless login with phoenix

Introducing how to implement passwordless login with phoenix framework

Jul 27 2016 : Thiago Borges

Beam Olympics

Our newest game to test your Beam Skills

Jul 14 2016 : Brujo Benavides


Three Open Source Projects, one App

Jun 28 2016 : Andrés Gerace


Running credo checks for elixir code on your github pull requests

Jun 16 2016 : Alejandro Mataloni

See all Inaka's blog posts >>


Tom Ryan wrote this on July 21, 2014 under inaka, ios .

Introducing IKJayma

IKJayma ( is a new, super-easy to use code library that makes it a breeze to talk to a RESTful web server, all the while keeping your UIViewControllers neat and tidy.

How to use IKJayma

First of all, take a look at the documentation.

There are just two classes you need to subclass to begin talking with your RESTful server:




Let's create a Contact object:

Here's the Interface.

@interface IKContact : IJAbstractDocument
@property (nonatomic,strong)NSString * contactName;

Here's the Implementation.

@implementation IKContact

-(id)initWithDictionary:(NSDictionary *)dictionary {
    self = [super init];

    if (self) {
        if(dictionary[@"id"]) self.documentId = dictionary[@"id"];
        [self refreshWithDictionary:dictionary];
    return self;

-(void)refreshWithDictionary:(NSDictionary *)dictionary {
    if(dictionary[@"name"]) self.contactName = dictionary[@"name"];

-(NSDictionary *)dictionaryRepresentation {

    NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
    if(self.documentId && self.documentId.length > 0) dictionary[@"id"] = self.documentId;
    if(self.contactName && self.contactName.length > 0) dictionary[@"name"] = self.contactName;

    return dictionary;


Now let's create the Repository:

Here's the Interface:

@interface IKContactsRepository : IJAbstractRepository


Here's the Implementation:

@implementation IKContactsRepository
-(id)initWithBackend:(IJAFNetworkingBackend *)backend {
    self = [super init];
    if (self) {
        self.backend = backend;
        self.serverUrl = @"http://localhost:9000/api";
        self.basePath = @"contacts";
    return self;


If you choose, you can make type-specific overrides of the IJAbstractRepository. It's recommended that you do so, but it's not strictly necessary.

Your View Controller:

@interface IKViewController ()
    @property (nonatomic, strong) IKContactsRepository *contactsRepository;
    @property (nonatomic, strong) NSMutableArray *contactsArray;
    @implementation IKViewController
    - (void)viewDidLoad {
        IJAFNetworkingBackend *contactsBackend = [[IJAFNetworkingBackend alloc] init];
        self.contactsRepository = [[IKContactsRepository alloc]initWithBackend:contactsBackend];
        self.contactsArray = [NSMutableArray array];

To create a new contact in this view controller (which is also created on the server):

- (IBAction)createContact:(id)sender {
        NSDictionary * contactDictionary = @{@"name" : self.textFieldName.text};

        IKContact * contact = [[IKContact alloc] initWithDictionary:contactDictionary];

        [self.contactsRepository createDocument:contact success:^(IJAbstractDocument *document) {
                [self.contactsArray addObject:document];
            } failure:^(IJError *error) {
                [[[UIAlertView alloc]initWithTitle:@"ERROR"
                                 otherButtonTitles: nil] show];

That's it!

You now have a contact created on the server, and refreshed on the client-side too!

With very little code, you now have a RESTful conversation between client and server. You've also achieved good separation of your networking code from your view controller and your model objects. As an added bonus, your code is now very easy to construct unit tests for.