Latest0.1.1
Homepagehttps://github.com/xfyre/RestKitMapper
LicenseMIT
Platformsios 7.0, requires ARC
DependenciesRestKit
Authors

Overview

RestKitMapper is a wrapper around RestKit, popular Objective-C framework for REST API access. Its primary intention is to hide RestKit configuration complexity and wrap REST API calls in simple and intuitive methods.

Features

RestKitMapper allows you to configure RestKit mappings declaratively. Supported RestKit features include:

  • Attribute mappings and primary keys
  • Dynamic path-based mappings
  • Full support for relationships
  • Request object mappings
  • Error response mappings

Getting started

To get started with RestKitMapper you should fully understand RestKit concepts (and, in particular, RestKit mappings). Please read RestKit docs if you haven’t done so yet. Installation is simple:

  • Include RestKitMapper in your Podfile (if you’re not yet familar with CocoaPods, that’s a good reason to start) and run pod install
  • Copy and edit RestKitMapper configuration file (sample file available in RestKitMapper project directory as Config/RestKitMapper.plist. Place it anywhere in your project file hierarchy.
  • Include and initialize RestKitMapper and your application
#include <RestKitMapper/RestKitMapper.h>

- (void)initializeRestKitMapperDefaults
{
  [RKMRestKitMapper configureWithFileName:@"RestKitMapperConfig"
                    serverBaseUrl:@"https://my.server:8080"
                    contextUrl:@"/api/v2"
                    modelName:@"MyModelName"];
}

- (void)callMyRestApiMethod
{
  RKMRestKitMapper *restKitMapper = [RKMRestKitMapper sharedInstance];
  [restKitMapper get: @"/relative_api_url" cached: NO withParams: nil success: ^(id result) {
    NSArray *items = result; // result normally contains NSArray of retrieved entities
    // handle results
    self.tableItems = items;
    [self.tableView reloadData];
  } failure:^(NSError *error) {
    // handle error
    NSLog("REST error: %@", error);
  }];
}

More information

Author

Ilya Obshadko

Latest podspec

{
    "name": "RestKitMapper",
    "version": "0.1.1",
    "summary": "Declarative-style configurator for RestKit.",
    "description": "                       RestKitMapper allows to perform declarative-style configuration of RestKitn                       for your application using property file.n                       n                       The following RestKit features are supported:n                       * Attributes mappingsn                       * Primary keysn                       * Relationships (by reference and by primary key value)n                       * Request mappingsn                       * Error mappingsn",
    "homepage": "https://github.com/xfyre/RestKitMapper",
    "license": "MIT",
    "authors": {
        "Ilya Obshadko": "[email protected]"
    },
    "source": {
        "git": "https://github.com/xfyre/RestKitMapper.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Classes",
    "resource_bundles": {
        "RestKitMapper": [
            "Assets/*"
        ]
    },
    "prefix_header_contents": "    #ifdef __OBJC__n      #import n      #import n      #import n      #import n    #endifn",
    "dependencies": {
        "RestKit": []
    }
}

Pin It on Pinterest

Share This