-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
# GreedNetwork | ||
network request for iOS, based on [AFNetworking](https://github.com/AFNetworking/AFNetworking) and [MJExtension](https://github.com/CoderMJLee/MJExtension) | ||
# Installation | ||
pod 'GreedNetwork' | ||
# Usage | ||
## [NSObject+GreedNetwork](https://github.com/greedlab/GreedNetwork/blob/master/GreedNetwork/NSObject%2BGreedNetwork.h) | ||
``` objc | ||
- (void)testRequest | ||
{ | ||
GRTestForm *form = [[GRTestForm alloc] init]; | ||
form.q = @"GreedNetwork"; | ||
[self requestWithNetworkForm:form success:^(GRNetworkResponse *responseObject) { | ||
NSLog(@"request:%@",responseObject.responseDictionary); | ||
} failure:^(NSError *error) { | ||
NSLog(@"request:%@",[error userInfo]); | ||
}]; | ||
} | ||
``` | ||
## [GRNetworkQueue](https://github.com/greedlab/GreedNetwork/blob/master/GreedNetwork/GRNetworkQueue.h) | ||
``` objc | ||
- (void)testQueue | ||
{ | ||
for (NSInteger index = 0; index < 2; index ++) { | ||
GRTestForm *form = [[GRTestForm alloc] init]; | ||
form.q = @"GreedNetwork"; | ||
form.successBlock = ^(GRNetworkResponse *responseObject) { | ||
NSLog(@"queue_%@:%@",@(index),responseObject.responseDictionary); | ||
}; | ||
form.failureBlock = ^(NSError *error) { | ||
NSLog(@"queue_%@:%@",@(index),[error userInfo]); | ||
}; | ||
[[GRNetworkQueue getInstance] addForm:form]; | ||
} | ||
} | ||
``` | ||
# Release Notes | ||
deveoping... | ||
* 0.0.1 first version | ||
|
||
# LICENSE | ||
MIT |