{"id":25243022,"url":"https://github.com/0x0c/m2dapigatekeeper","last_synced_at":"2025-04-05T20:42:06.111Z","repository":{"id":21143043,"uuid":"24445312","full_name":"0x0c/M2DAPIGatekeeper","owner":"0x0c","description":"Simple API networking framework","archived":false,"fork":false,"pushed_at":"2019-02-20T08:58:41.000Z","size":131,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T10:48:47.063Z","etag":null,"topics":["api-client","ios","ios-lib","networking","objective-c"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0x0c.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-25T05:45:28.000Z","updated_at":"2019-02-20T08:57:21.000Z","dependencies_parsed_at":"2022-08-28T09:21:59.908Z","dependency_job_id":null,"html_url":"https://github.com/0x0c/M2DAPIGatekeeper","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2FM2DAPIGatekeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2FM2DAPIGatekeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2FM2DAPIGatekeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2FM2DAPIGatekeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0x0c","download_url":"https://codeload.github.com/0x0c/M2DAPIGatekeeper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399898,"owners_count":20932876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","ios","ios-lib","networking","objective-c"],"created_at":"2025-02-12T00:45:05.336Z","updated_at":"2025-04-05T20:42:06.095Z","avatar_url":"https://github.com/0x0c.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# M2DAPIGatekeeper\n\n[![CI Status](http://img.shields.io/travis/Akira Matsuda/M2DAPIGatekeeper.svg?style=flat)](https://travis-ci.org/Akira Matsuda/M2DAPIGatekeeper)\n[![Version](https://img.shields.io/cocoapods/v/M2DAPIGatekeeper.svg?style=flat)](http://cocoadocs.org/docsets/M2DAPIGatekeeper)\n[![License](https://img.shields.io/cocoapods/l/M2DAPIGatekeeper.svg?style=flat)](http://cocoadocs.org/docsets/M2DAPIGatekeeper)\n[![Platform](https://img.shields.io/cocoapods/p/M2DAPIGatekeeper.svg?style=flat)](http://cocoadocs.org/docsets/M2DAPIGatekeeper)\n\n## Requirements\n\n- Runs on iOS 7.0 or later.\n\n## Contribution\n\nPlease use git flow and send pull request to `develop` branch.\n\n## Installation\n\nM2DAPIGatekeeper is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n    pod \"M2DAPIGatekeeper\"\n\n## Usage\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\nOnly two steps to send request like this.\n\n\t// Send asynchronous request\n\tM2DAPIRequest *r = [M2DAPIRequest GETRequest:[NSURL URLWithString:@\"URL\"]];\n\t[[r whenSucceeded:^(M2DAPIRequest *request, NSDictionary *httpHeaderFields, id parsedObject) {\n\t\t//When result condition is true\n\t}] whenFailed:^(M2DAPIRequest *request, NSDictionary *httpHeaderFields, id parsedObject, NSError *error) {\n\t\t//When result condition is false\n\t}];\n\nA lot of methods to control each sequences.\nFor example,\n\n\tM2DAPIGatekeeper *gatekeeper = [M2DAPIGatekeeper sharedInstance];\n\t[gatekeeper parseBlock:^id(NSData *data, NSError *__autoreleasing *error) {\n\t\tid result = nil;\n\t\tif (*error == nil) {\n\t\t\tresult = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error];\n\t\t}\n\t\treturn result;\n\t}];\n\t\n\t[gatekeeper resultConditionBlock:^BOOL(M2DAPIRequest *request, NSURLResponse *response, id parsedObject, NSError *__autoreleasing *error) {\n\t\treturn [(NSHTTPURLResponse *)response statusCode] == 200;\n\t}];\n\n\t[gatekeeper initializeBlock:^(M2DAPIRequest *request, NSDictionary *params) {\n\t\tdispatch_async(dispatch_get_main_queue(), ^{\n\t\t\t// Show hud when start request\n\t\t});\n\t}];\n\t[gatekeeper finalizeBlock:^(M2DAPIRequest *request, NSDictionary *httpHeaderField, id parsedObject) {\n\t\tdispatch_async(dispatch_get_main_queue(), ^{\n\t\t\t// Dismiss hud when finish request\n\t\t});\n\t}];\n\nand so more.\n\nWhen start connection, unique identifier is generated.\nYou can use the identifier to cancel request .\n\n\tNSString *identifier = [gatekeeper sendRequest:...];\n\t[gatekeeper cancelRequestWithIdentifier:identifier];\n\nPlease see also M2DAPIGatekeeper.h or M2DAPIRequest.h.\n\n## Author\n\nAkira Matsuda, akira.m.itachi@gmail.com\n\n## License\n\nM2DAPIGatekeeper is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x0c%2Fm2dapigatekeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0x0c%2Fm2dapigatekeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x0c%2Fm2dapigatekeeper/lists"}