{"id":28214537,"url":"https://github.com/goodrequest/goodswift","last_synced_at":"2025-06-26T16:09:23.168Z","repository":{"id":17790371,"uuid":"82716611","full_name":"GoodRequest/GoodSwift","owner":"GoodRequest","description":"Some good swift extensions, handfully crafted by GoodRequest team.","archived":false,"fork":false,"pushed_at":"2022-06-29T07:55:56.000Z","size":81,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-26T16:06:02.847Z","etag":null,"topics":["ios","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodRequest.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-02-21T19:06:45.000Z","updated_at":"2023-02-09T14:34:03.000Z","dependencies_parsed_at":"2022-08-20T20:50:34.661Z","dependency_job_id":null,"html_url":"https://github.com/GoodRequest/GoodSwift","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/GoodRequest/GoodSwift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodRequest%2FGoodSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodRequest%2FGoodSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodRequest%2FGoodSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodRequest%2FGoodSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodRequest","download_url":"https://codeload.github.com/GoodRequest/GoodSwift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodRequest%2FGoodSwift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262099731,"owners_count":23258670,"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":["ios","swift"],"created_at":"2025-05-17T21:08:01.643Z","updated_at":"2025-06-26T16:09:23.150Z","avatar_url":"https://github.com/GoodRequest.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![.goodswift](https://s3-eu-west-1.amazonaws.com/dashboard-goodrequest/assets/goodswift.png)\n\n\n[![Version](https://img.shields.io/cocoapods/v/GoodSwift.svg?style=flat)](http://cocoapods.org/pods/GoodSwift)\n[![License](https://img.shields.io/cocoapods/l/GoodSwift.svg?style=flat)](http://cocoapods.org/pods/GoodSwift)\n[![Platform](https://img.shields.io/cocoapods/p/GoodSwift.svg?style=flat)](http://cocoapods.org/pods/GoodSwift)\n\nSome good swift extensions, handfully crafted by GoodRequest team.\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Author](#author)\n- [License](#license)\n\n## Requirements\n\n- iOS 10.0+\n- Xcode 10.0+\n- Swift 4.2 (for Swift 4.0 use version 0.9.0)\n\n## Installation\n\n**.good**swift is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'GoodSwift'\n```\n\n## Usage\n\n### Mapping\n\n**.good**swift allows you to easily decode JSON objects from [Alamofire](https://github.com/Alamofire/Alamofire) responses using [Unbox](https://github.com/JohnSundell/Unbox) decoder. You can see examples how to map your model in [Unbox readme](https://github.com/JohnSundell/Unbox/blob/master/README.md).\n\n```swift\nimport Unbox\n\nstruct Foo {\n    let origin: String\n    let url:    URL\n}\n\nextension Foo: Unboxable {\n    init(unboxer: Unboxer) throws {\n        self.origin = try unboxer.unbox(key: \"origin\")\n        self.url = try unboxer.unbox(key: \"url\")\n    }\n}\n```\n\nThen you just need to use `unbox` or `unboxArray` functions to decode your model.\n\n```swift\nimport Alamofire\nimport GoodSwift\n\nAlamofire.request(\"https://httpbin.org/get\").unbox(completion: { (response: DataResponse\u003cFoo\u003e) in\n    switch response.result {\n    case .success(let foo):\n        // Decoded object\n    case .failure(let error):\n        // Handle error\n    }\n})\n```\n\n### Logging\n\nAutomatic logging is enabled when there is `Active Compilation Conditions` flag `DEBUG` defined in project's `Build Settings`. If you have added **.good**swift using [CocoaPods](http://cocoapods.org) you need to add flag `DEBUG` manually into `Active Compilation Conditions` in **.good**swift pod `Build Settings`. If you don't want to add this flag manually after each `pod install` you just need to add this script at the end of your `Podfile`.\n\n```ruby\npost_install do |installer|\n    installer.pods_project.targets.each do |target|\n        if target.name == 'GoodSwift'\n            target.build_configurations.each do |config|\n                if config.name == 'Debug'\n                    config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = 'DEBUG'\n                    else\n                    config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = ''\n                end\n            end\n        end\n    end\nend\n```\n#### Log level\nYou can choose logging level by setting `logLevel` static variable from `DataRequest` class. For now you can choose from these logging levels:\n- error - prints only when error occurs\n- info (default) - prints request url with response status and error when occurs\n- verbose - prints everything including request body and response object\n\n### Chain animations\n\n`AnimationChain` allows you to easily chain UIView animations:\n\n```swift\nUIView.animationChain.animate(withDuration: 2) {\n    view.alpha = 0.0\n}.animate(withDuration: 2) {\n    view.alpha = 1.0\n}.start {\n    debugPrint(\"Animation finished\")\n}\n```\n\n### LinkedList implementation\n\n**.good**swift allows you to use default implementation of `LinkedList` (Queue, FIFO).\n[Wiki](https://en.wikipedia.org/wiki/Linked_list)\n\n```swift\nlet queue = LinkedList\u003cInt\u003e()\n\nprint(queue.isEmpty)            // true\n\nqueue.push(1)                   // [1]\nqueue.push(2)                   // [1, 2]\nqueue.push(3)                   // [1, 2, 3]\n\nprint(queue.contains(1))        // true\nprint(queue.filter { $0 \u003e 1 })  // [2, 3]\nprint(queue.map { $0 + 2 })     // [3, 4, 5]\nprint(queue.pop())              // Optional(1)\nprint(queue.pop())              // Optional(2)\nprint(queue.isEmpty)            // false\nprint(queue.peak())             // Optional(3)\nprint(queue.pop())              // Optional(3)\nprint(queue.isEmpty)            // true\n```\n\n\n## Author\n\nMarek Spalek, marek.spalek@goodrequest.com\n\n## Contributors\n\nPavol Kmet, pavol.kmet@goodrequest.com\n\nTomas Gibas, tomas.gibas@goodrequest.com\n\nDominik Petho, dominik.petho@goodrequest.com\n\nFilip Sasala, filip.sasala@goodrequest.com\n\n## License\n\n**.good**swift 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%2Fgoodrequest%2Fgoodswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodrequest%2Fgoodswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodrequest%2Fgoodswift/lists"}