Latest 6.0.1
License MIT
Platforms ios 8.0, osx 10.9, tvos 9.0, requires ARC

VIMObjectMapper converts JSON into model objects.


Add VIMObjectMapper to your project. Do this by including it as a git submodule or by using cocoapods:

# Add this to your podfile
target 'MyTarget' do
    pod 'VIMObjectMapper', '{CURRENT_POD_VERSION}'


Subclass VIMModelObject

Make your custom model object a subclass of VIMModelObject and optionally implement the VIMMappable protocol methods:

#import "VIMModelObject.h"

@class VIMPictureCollection;

@interface VIMUser : VIMModelObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, strong) VIMPictureCollection *pictureCollection;
@property (nonatomic, strong) NSDictionary *uploadQuota;
@property (nonatomic, strong) NSArray *websites;

#import "VIMUser.h"
#import "VIMPictureCollection.h"
#import "VIMObjectMapper.h"

@implementation VIMUser

#pragma mark - VIMMappable // All methods are optional, implement to specify how the object should be "inflated"

- (NSDictionary *)getObjectMapping
    return @{@"pictures": @"pictureCollection"};

- (Class)getClassForCollectionKey:(NSString *)key
    if ([key isEqualToString:@"uploadQuota"])
        return [NSDictionary class];

    if ([key isEqualToString:@"websites"])
        return [NSArray class];

    return nil;

- (Class)getClassForObjectKey:(NSString *)key
    if ([key isEqualToString:@"pictures"])
        return [VIMPictureCollection class];

    return nil;

- (void)didFinishMapping
    // Do any post-parsing work you might want to do

Get some JSON

    user = {
        name = "Homer Simpson";
        pictures = {
            uri = "...";
            sizes = (...);
        "upload_quota" = { ... };
        websites = ( ... );

Let VIMObjectMapper go to work

NSDictionary *JSON = ...;

VIMObjectMapper *mapper = [[VIMObjectMapper alloc] init];

[mapper addMappingClass:[VIMUser class] forKeypath:@"user"];

VIMUser *user = [mapper applyMappingToJSON:JSON];

Found an Issue?

Please file it in the git issue tracker.

Want to Contribute?

If you’d like to contribute, please follow our guidelines found in


VIMObjectMapper is available under the MIT license. See the LICENSE file for more info.


Tweet at us here: @vimeoapi.

Post on Stackoverflow with the tag vimeo-ios.

Get in touch here.

Interested in working at Vimeo? We’re hiring!

Latest podspec

    "name": "VIMObjectMapper",
    "version": "6.0.1",
    "summary": "An automatic JSON to model object converter.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": ""
    "authors": "Kashif Mohammad",
    "social_media_url": "",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "tvos": "9.0"
    "source": {
        "git": "",
        "tag": "6.0.1"
    "source_files": "VimeoObjectMapper/VimeoObjectMapper/Source/*.{h,m}",
    "requires_arc": true,
    "ios": {
        "frameworks": "Foundation"
    "osx": {
        "frameworks": "Foundation"
    "tvos": {
        "frameworks": "Foundation"

Pin It on Pinterest

Share This