Skip to content

Instantly share code, notes, and snippets.

@TadeasKriz
Created March 3, 2014 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TadeasKriz/9325698 to your computer and use it in GitHub Desktop.
Save TadeasKriz/9325698 to your computer and use it in GitHub Desktop.
@protocol AGResponse <NSObject>
// Array of unmarshaled objects
@property (readonly, nonatomic) NSArray* objects;
@property (readonly, nonatomic) BOOL hasPrevious;
@property (readonly, nonatomic) BOOL hasNext;
@optional
-(void)next:(void (^)(id<AGResponse> response))success failure:(void (^)(NSError *error))failure;
-(void)previous:(void (^)(id<AGResponse> response))success failure:(void (^)(NSError *error))failure;
@end
[pipe read:^(id<AGResponse> response) {
if(response.hasNext) {
[response next:^(id<AGResponse> response) {
} failure:^(NSError* error) {
}];
}
} failure:^(NSError* error) {
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment