Latest 0.1.0
Homepage https://github.com/Cain1127/YSMRequestMappingExtend
License MIT
Platforms ios 7.1, requires ARC
Dependencies AFNetworking, RestKit/ObjectMapping
Authors

CI Status
Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.
pod ‘YSMRequestMappingExtend’, ‘~> 0.1.0’

Requirements

iOS 7.1

Installation

YSMRequestMappingExtend is available through CocoaPods. To install
it, simply add the following line to your Podfile:

How to use.

1、custom data model : YSMRequestCustomDataModel, it’s subClass of YSMMappingBaseDataModel.

2、add property for custom data model by macro define on YSMMappingBaseDataModel.h file.

3、property name is server json value name.
ep:{type : 1;
info : "hello worlk";
}
YSMProperty_Base(BOOL,type);
YSMProperty_String(info);
using : customDataModel.type

4、import "YSMRequestManager.h"

5、add request task
self.listView.dataSource = self;
self.listView.delegate = self;
YSMRequestTaskDataModel requestTask = [[YSMRequestTaskDataModel alloc] init];
requestTask.target = self;
requestTask.httpType = rRequestHttpTypeGet;
requestTask.requestURLString = @"http://c.m.163.com/nc/article/list/T1348648517839/0-20.html";
requestTask.mappingClass = @"YSMRequestCustomDataModel";
requestTask.requestParams = nil;
requestTask.requestResultCallBack = ^(REQUEST_RESULT_STATUS resultStatus,id resultData,NSError
error){

if (rRequestResultStatusSuccess == resultStatus) {

self.dataSource = resultData;
[self.listView reloadData];

} else {

NSLog(@"request fail:%@",error);

}

};

6、start request data
[YSMRequestManager requestDataWithRequestTask:requestTask];

Author

ysmeng, [email protected]

License

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

Latest podspec

{
    "name": "YSMRequestMappingExtend",
    "version": "0.1.0",
    "summary": "AFNetworking+Restkit:http request and mapping special object",
    "description": "                        1u3001AFNetworking;n                        2u3001Restikit/NKObjectMapping;n                        3u3001Using:n                            au3001custom data model inherit YSMMappingBaseDataModel;n                            bu3001adding attributes like the sample:n                                NSString : YSMProperty_String(title);n                                NSArray : YSMProperty_Array(CustomSubClassOfYSMMappingBaseDataModel, property_name);n                                CustomClass : YSMProperty_Class(propertyClass,propertyName);n                            cu3001property have setter and getter;n",
    "homepage": "https://github.com/Cain1127/YSMRequestMappingExtend",
    "license": "MIT",
    "authors": {
        "ysmeng": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Cain1127/YSMRequestMappingExtend.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "7.1"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "YSMRequestMappingExtend": [
            "Pod/Assets/*.png"
        ]
    },
    "dependencies": {
        "AFNetworking": [
            "~> 2.5.4"
        ],
        "RestKit/ObjectMapping": [
            "~> 0.24.1"
        ]
    }
}

Pin It on Pinterest

Share This