{"id":16683790,"url":"https://github.com/freesuraj/quickfire","last_synced_at":"2026-05-20T15:38:36.081Z","repository":{"id":146931263,"uuid":"176421799","full_name":"freesuraj/QuickFire","owner":"freesuraj","description":"Rapid fire, quick start networking library in Swift","archived":false,"fork":false,"pushed_at":"2019-03-20T00:16:09.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T08:28:51.759Z","etag":null,"topics":["alamofire","api","ios","network","rest","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/freesuraj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-19T04:12:59.000Z","updated_at":"2019-03-20T00:16:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b25b1d2-a436-4a03-89fd-25be562f47fb","html_url":"https://github.com/freesuraj/QuickFire","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesuraj%2FQuickFire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesuraj%2FQuickFire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesuraj%2FQuickFire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freesuraj%2FQuickFire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freesuraj","download_url":"https://codeload.github.com/freesuraj/QuickFire/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243403457,"owners_count":20285391,"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":["alamofire","api","ios","network","rest","swift"],"created_at":"2024-10-12T14:26:09.430Z","updated_at":"2025-12-28T15:17:49.668Z","avatar_url":"https://github.com/freesuraj.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"### QuickFire\n\nNormal Network Library requirement for iOS apps generally boils down to following simple steps:\n\n- Making a Request.\n- Fire the Request asynchronously and receive either a successful data or an error.\n\nSince the advent of `URLSessionDataTask` in swift, using custom network libraries like Alamofire are no longer necessary. It's easy enough to write a simple wrapper to create a `URLSessionDataTask` and observe the response in the callback.\n\nWith that said, we still need to write our custom data handler to decide which data is useful and which data is not useful.\n\nLet's see an example:\n\nWe have a `User Login` api at this end point:\n\n`https://example.com/user/login`\n\nWe want to receive a `User` Object when I execute the api with parameters `user_name` and `password`.\n\n\n**QuickFire** is a wrapper that takes away all the steps that happens in between the request and response and let's you focus on defining request and response ONLY.\n\n```swift\nstruct UserLoginRequest: Request {\n    var path: String = \"POST /user/login\"\n    var params: [Key: Value] {\n        return [\"user_name\": userName, \"password\": password]\n    }\n    \n    private var userName: String\n    private var password: String\n    \n    init(userName: String, password: String) {\n    \tself.userName = userName\n        self.password = password\n    }\n}\n\n\nstruct User: Response {\n    var fullName: String\n    var badge: String\n    var balance: Double\n}\n\nUserLoginRequest(userName: \"xxx\", password: \"xxxx\").execute().then(User).catch(Error)\n\n```\n\nAnother example:\n\n```swift\nimport QuickFire\n\nextension Request {\n    public var headers: [String: String] { return [\"referer\": \"example.com\"] } // Common headers for all requests\n}\n\npublic struct ProductDetail: Response {\n\t\n    var name: String\n\n    public init?(json: Any) {\n        guard let dict = json as? [String: Any], let title = dict[\"title\"] as? String else { return nil }\n        name = title\n    }\n}\n\npublic struct ProductDetailRequest: Request {\n\t\n    public var path: String {\n        return \"GET /api/v1/products/\\(productId)/\"\n    }\n\n    let productId: String\n    public let responseType: Response.Type = ProductDetail.self\n\n    public init(productId: String) {\n        self.productId = productId\n    }\n}\n\nclass Example {\n\n    func testExample() {\n        func onDetail(_ response: ProductDetail) {\n            print(\"product is \\(response.name)\")\n        }\n\n        func onError(_ error: Error) {\n            print(\"error: \\(error.localizedDescription)\")\n        }\n\n    NetworkConfig.shared.baseUrl = \"https://www.example.com\"\n    ProductDetailRequest(productId: \"1111\").execute().then(onDetail).catch(onError)\n    }\n\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreesuraj%2Fquickfire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreesuraj%2Fquickfire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreesuraj%2Fquickfire/lists"}