{"id":25195938,"url":"https://github.com/simplisticated/flexible","last_synced_at":"2025-04-04T15:44:03.013Z","repository":{"id":56911422,"uuid":"143195246","full_name":"simplisticated/Flexible","owner":"simplisticated","description":"Smart arrays implemented in Swift","archived":false,"fork":false,"pushed_at":"2018-08-31T21:08:44.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T20:38:50.481Z","etag":null,"topics":["array","array-filtering","array-search","ios","nsarray","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplisticated.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":"2018-08-01T18:46:34.000Z","updated_at":"2021-12-23T22:19:25.000Z","dependencies_parsed_at":"2022-08-20T20:20:45.703Z","dependency_job_id":null,"html_url":"https://github.com/simplisticated/Flexible","commit_stats":null,"previous_names":["igormatyushkin014/flexible"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FFlexible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FFlexible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FFlexible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplisticated%2FFlexible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplisticated","download_url":"https://codeload.github.com/simplisticated/Flexible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208022,"owners_count":20901568,"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":["array","array-filtering","array-search","ios","nsarray","swift","xcode"],"created_at":"2025-02-10T01:39:10.755Z","updated_at":"2025-04-04T15:44:02.988Z","avatar_url":"https://github.com/simplisticated.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\" \u003e\n\t\u003cimg src=\"/Images/logo_2048_600.png\" alt=\"Flexible\" title=\"Flexible\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://swift.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://cocoapods.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/cocoapods/v/Flexible.svg\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://cocoapods.org\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/cocoapods/dt/Flexible.svg\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/License-Apache 2.0-blue.svg?style=flat\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n## At a Glance\n\n`Flexible` is a tool that simplifies work with arrays in Swift.\n\n## How To Get Started\n\n- Copy content of `Source` folder to your project.\n\nor\n\n- Use `Flexible` cocoapod\n\n## Requirements\n\n* iOS 9 and later\n* Xcode 9 and later\n* Swift 4.1\n\n## Usage\n\nFiltering array is much easier with `Flexible`:\n\n```swift\nlet sourceArray = [\n    1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n]\n\nlet result = sourceArray.flx\n    .take(.last(count: 4))         // Take last 4 elements\n    .mapped { \"value = \\($0)\" }    // Map Int element to String value\n    .where { $0 \u003c 8 }              // Filter source elements\n\nprint(result) // [\"value = 4\", \"value = 5\", \"value = 6\", \"value = 7\"]\n```\n\nTake first 4 elements from array:\n\n```swift\nlet result = sourceArray.flx\n    .take(.first(count: 4))\n    .noMapping()\n    .noFilter()\n\nprint(result) // [1, 2, 3, 4]\n```\n\n\nRetrieve array with elements multiplied by 2:\n\n```swift\nlet result = sourceArray.flx\n    .take(.all)\n    .mapped { $0 * 2 }\n    .noFilter()\n\nprint(result) // [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]\n```\n\n## License\n\n`Flexible` is available under the Apache 2.0 license. See the [LICENSE](./LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fflexible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplisticated%2Fflexible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplisticated%2Fflexible/lists"}