This is a project to discover common requirements of API request within iOS applications.
(not Swift)
It's simple and uses NSURLConnection. (I think AFNetworking library can be one of options.) Actullay, this is very simple prototype and needs contributions.
See descriptions below.
- has NSURLRequest class about single API.
- has a proper parser for that API.
- can send API request and pass the response to the parser.
- notifies API result via block
- schedules SimpleAPIRequest(start or cancel).
- notifies SimpleAPIRequest's result via block
- These are pair(request and response).
- SampleAPIBuilder describes actual API request(URL, METHOD, Timeout...).
- SimpleJSONParser describes how to parse the response.
- Information about which API request use which parser is definded within SampleAPIBuilder.
[[APIHandler defaultAPIHandler] sendAPIRequest:[SampleAPIBuilder buildAPI] completionHandler:^(BOOL isSuccess, NSDictionary *responseResult, NSError *error) {
NSLog(@"\nParsed JSON\n%@",responseResult.description);
}];