Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
greedbell committed Oct 23, 2015
1 parent 452f66a commit b35496c
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion README.md
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

0 comments on commit b35496c

Please sign in to comment.