Latest 0.1.0
Homepage https://github.com/travisjeffery/NSDictionary-TRVSUnderscoreCamelCaseAdditions
License MIT
Platforms ios 5.0, osx 10.7, requires ARC
Authors

Category on NSDictionary providing some methods for converting the dictionary’s keys to/from under_score/camelCase.

@interface NSDictionary (TRVSUnderscoreCamelCaseAdditions)

- (NSDictionary *)dictionaryWithCamelCaseKeys;
- (NSDictionary *)dictionaryWithUnderscoreKeys;
@end
[@{ @"user_name": @"travisjeffery", @"user_id" : @"Numero Uno" } dictionaryWithCamelCaseKeys];
# =>
@{ @"userName" : @"travisjeffery", @"userId" : @"Numero Uno"};

[@{ @"userName" : @"travisjeffery", @"userId" : @"Numero Uno"} dictionaryWithUnderscoreKeys];
# =>
@{ @"user_name": @"travisjeffery", @"user_id" : @"Numero Uno" };

Install

Available as the Cocoapod NSDictionary+TRVSUnderscoreCamelCaseAdditions, or just use the NSDictionary+TRVSUnderscoreCamelCaseAdditions.{m,h} files.

Self-Promotion

If you’re feeling especially charitable or interested in Objective-C, JavaScript, Ruby, and Math, follow travisjeffery on Twitter and GitHub.

License (MIT)

Copyright © Travis Jeffery. See LICENSE for details.

Latest podspec

{
    "name": "NSDictionary+TRVSUnderscoreCamelCaseAdditions",
    "version": "0.1.0",
    "summary": "Convert NSDictionary keys to/from under_score/camelCase. Useful when working with JSON APIs, etc.",
    "homepage": "https://github.com/travisjeffery/NSDictionary-TRVSUnderscoreCamelCaseAdditions",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Travis Jeffery": "[email protected]"
    },
    "source": {
        "git": "https://github.com/travisjeffery/NSDictionary-TRVSUnderscoreCamelCaseAdditions.git",
        "tag": "v0.1.0"
    },
    "platforms": {
        "ios": "5.0",
        "osx": "10.7"
    },
    "source_files": "*{.h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This