Latest 2.0.0
Homepage https://github.com/ScottPetit/Maris
License MIT
Platforms ios 7.0, requires ARC
Dependencies Mantle, AFNetworking/NSURLSession
Frameworks Foundation
Authors

The glue between AFNetworking and Mantle

Build Status

Maris is the glue between AFNetworking and Mantle. With Maris you never have to write another AFNetworking Response Serializer again. Just tell Maris what MTLModel subclass to use and get your fully formed objects back.

Maris was inspired by me trying to use Overcoat on a project but wanting to use the NSURLSession side of AFNetworking. Therefore Maris supports NSURLSession and AFNetworking out of the box.

Maris is named after Roger Maris, a former American baseball player who is most known for hitting (at the time) a Major League record 61 home runs during the 1961 season for the New York Yankees, breaking Babe Ruth’s single-season record of 60 home runs in 1927.

Usage

Maris provides two subclasses of AFNetworking classes. REMHTTPSessionManager and REMHTTPRequestOperationManager. These provide the interface by which you can unify AFNetworking and Mantle. Instead of using the AFHTTPSessionManager method of

AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager GET:@"http://example.com/resources.json" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"JSON: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error: %@", error);
}];

Maris provides a method like this

REMHTTPSessionManager *manager = [REMHTTPSessionManager manager];
[manager GET:@"http://example.com/resources.json" parameters:nil modelClass:[MYObject class] keyPath:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"Model object(s): %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error: %@", error);
}];

By providing the modelClass and the key path for your objects (can be nil), Maris is able to handle deserializing JSON into your model objects. It’s that easy.

Latest podspec

{
    "name": "Maris",
    "version": "2.0.0",
    "authors": {
        "Scott Petit": "[email protected]ail.com"
    },
    "homepage": "https://github.com/ScottPetit/Maris",
    "summary": "AFNetworking 2.0 and Mantle made easy",
    "source": {
        "git": "https://github.com/ScottPetit/Maris.git",
        "tag": "v2.0.0"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "frameworks": "Foundation",
    "social_media_url": "https://twitter.com/scottpetit",
    "dependencies": {
        "Mantle": [
            "~> 2.0.0"
        ],
        "AFNetworking/NSURLSession": [
            "~> 3.0.0"
        ]
    },
    "source_files": [
        "Maris/Categories/*.{h,m}",
        "Maris/Serializers/*.{h,m}",
        "Maris/NSURLSession/*.{h,m}"
    ]
}

Pin It on Pinterest

Share This