Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@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