Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/lovemo/MVVMFramework
Browse files Browse the repository at this point in the history
  • Loading branch information
lovemo committed Apr 9, 2016
2 parents 399dc2e + 9329a2d commit b9b9a02
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,21 +231,18 @@ CocoaPods:
#####具体实现细节,[点击进入查看SUIMVVMNetwork](https://github.com/lovemo/SUIMVVMNetwork)

```objc
- (void)smk_viewModelWithGetDataSuccessHandler:(void (^)(NSArray *))successHandler {

NSString *url = @"http://news-at.zhihu.com/api/4/news/latest";
[SMKHttp get:url params:nil cachePolicy:SMKHttpReturnCacheDataThenLoad success:^(id responseObj) {
NSArray *array = responseObj[@"stories"];
self.smk_dataArrayList = [ThirdModel mj_objectArrayWithKeyValuesArray:array];
if (successHandler) {
successHandler(self.smk_dataArrayList);
- (NSURLSessionTask *)smk_viewModelWithProgress:(progressBlock)progress success:(successBlock)success failure:(failureBlock)failure {
return [[SMKAction sharedAction] sendRequestBlock:^id<SMKRequestProtocol>{
return [[FirstRequest alloc]init];
} progress:nil success:^(id responseObject) {
if (responseObject) {
NSArray *modelArray = [FirstModel mj_objectArrayWithKeyValuesArray:responseObject[@"books"]];
success(modelArray);
}

} failure:^(NSError *error) {

}];

}

```
Expand Down

0 comments on commit b9b9a02

Please sign in to comment.