{"id":19742506,"url":"https://github.com/maximkrouk/convenience","last_synced_at":"2026-06-08T13:32:23.542Z","repository":{"id":56906589,"uuid":"200126364","full_name":"maximkrouk/Convenience","owner":"maximkrouk","description":"Useful extensions, classes and protocols for swift applications. (beta)","archived":false,"fork":false,"pushed_at":"2019-11-14T11:39:36.000Z","size":208,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-15T04:24:01.346Z","etag":null,"topics":["cocoapods","convenience","decoding","extensions","hex","protocols","regex","swift","swift5-1","validators","xcode11"],"latest_commit_sha":null,"homepage":"","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/maximkrouk.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":"2019-08-01T22:24:28.000Z","updated_at":"2019-11-14T11:39:38.000Z","dependencies_parsed_at":"2022-08-20T19:20:23.557Z","dependency_job_id":null,"html_url":"https://github.com/maximkrouk/Convenience","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/maximkrouk/Convenience","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FConvenience","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FConvenience/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FConvenience/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FConvenience/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximkrouk","download_url":"https://codeload.github.com/maximkrouk/Convenience/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximkrouk%2FConvenience/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285954195,"owners_count":27260104,"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","status":"online","status_checked_at":"2025-11-23T02:00:06.149Z","response_time":135,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cocoapods","convenience","decoding","extensions","hex","protocols","regex","swift","swift5-1","validators","xcode11"],"created_at":"2024-11-12T01:31:59.618Z","updated_at":"2025-11-23T13:01:52.343Z","avatar_url":"https://github.com/maximkrouk.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convenience\n\n**The most convenient framework for your apps.**\n\n[![CI Status](https://travis-ci.org/maximkrouk/Convenience.svg?branch=master)](https://travis-ci.org/maximkrouk/Convenience) [![Version](https://img.shields.io/cocoapods/v/Convenience.svg?style=flat)](https://cocoapods.org/pods/Convenience) [![License](https://img.shields.io/cocoapods/l/Convenience.svg?style=flat)](https://cocoapods.org/pods/Convenience) [![Platform](https://img.shields.io/cocoapods/p/Convenience.svg?style=flat)](https://cocoapods.org/pods/Convenience)\n\n## The story\n\nProgramming is all about data. We modify data, store it, share it. You can see it in every app you do. So I've got enaugh writing the same code for decoding data, unwrapping optionals, subscripting collections and decided to... Use one folder called \"Reusable\" with all this stuff. And migrate it from project to project...\n\nOne day The Problem appeared. When you add anything to this folder in a new project, changes are not applied to the older ones. Xcode folder references could have solve this problem, but what if you have to work from remote and have no access to the folder?\n\nSo I decided to write this framework and share it with world. I'm gonna try make it as clean as I can, but if You find any garbage here - let me know c:\n\n## Usage\n\n### Bool\n\n- __Toggle__\n\n  `Bool().toggled == !Bool`\n\n  \n\n### CharacterSet\n\n- __ExpressibleByStringLiteral__\n\n  `let frameworkName = \"Convenience\" // == CharacterSet(charactersIn: \"Convenience\")`\n\n- __Static factory__\n\n  `.binaryDigits`\n\n  `.hexDigits`\n\n  \n\n### Codable\n\n- __Convenient coding__\n\n  `Encodable.encode(using encoder: ConvenientEncoder = JSONEncoder())`\n\n  `Decodable.decode(from data: Data, using encoder: ConvenientEncoder = JSONEncoder())`\n\n\n\n### Collection\n\n- __Safe subscripting__\n\n  `[1 ,2, 3][safe: 10] == nil`\n\n- __Int-ranged subscripting__ _for bidirectional collecions_\n\n  `\"String\"[0] == \"S\"`\n\n  `\"String\"[1..\u003c3] == \"tr\"`\n\n  `\"String\"[3...] == \"ing\"`\n\n  ...\n\n  \n\n### Colors\n\n- __Hex color converting__ _for NS and UI Colors_\n\n  `[NS/UI]Color(hex: \"#FA6878AA\")`\n\n  `[NS/UI]Color(hex: \"#FA6878\")`\n\n  `[NS/UI]Color(hex: \"FA6878\")`\n\n  `[NS/UI]Color(rgb: 0xfa6878ff)` _( from hex Int )_\n\n  `[NS/UI]Color(rgb: 0xFA6878)`\n\n\n\n### Data\n\n- __Decoding__\n\n  ```swift\n  let decoding = Data().decode(to: SomeDecodable.self)\n  decoding.value // SomeDecodable?\n  switch decoding {\n      case .success(let value):\n      \t  return value // SomeDecodable\n      case .failure(let error):\n        \tvc.showAlert(with: error) // for ex.\n  }\n  ```\n\n- __Getting a string__\n\n  `Data().string(using: .ascii)`\n\n  `Data().string()` _(UTF-8)_\n\n\n\n### Error\n\n- __Collect__\n\n  ```swift\n  // for now works only for () -\u003e Void funtions\n  func someThrowable() throws {}\n  \n  let errors: ErrorBag = Error.collect {\n  \t\tsomeThrowable\n  \t\tsomeThrowable\n  \t\tsomeThrowable\n  }\n  /* ==\n  collect {\n  \t\tsomeThrowable\n  \t\tsomeThrowable\n  \t\tsomeThrowable\n  }\n  */\n  \n  print(errors.localizedDescription)\n  // ==\n  errors.contents.forEach {  \n  \t  print($0.localizedDescriprion)\n  }\n  ```\n\n  \n\n### Optional\n\n- __Example__\n\n  ```swift\n  let a: Int? = 1 \t\t\t\t\t\t // a == 1\n  a.isNil\t\t\t\t \t\t\t\t\t\t\t // false\n  a.release() \t\t\t\t\t\t\t\t // a == nil\n  a.isNil\t\t\t\t \t\t\t\t\t\t\t // true\n  let b = a.unwrap(default: 3) // a == nil, b == 3\n  let c: SomeProtocol? = SomeInstance()\n  let d = c.cast(to: SomeInstance.self, default: SomeInstance())\n  ```\n\n  \n\n### NSLock\n\n### NSRegularExpression (Regex)\n\n### RawRepresentable\n\n### Cast\n\n### Modifications\n\n### String (ns, url, regex, crypto)\n\n### Protocols (TypeErasable, StaticNamedType)\n\n### PlainError\n\n----\n\n_( + Working on new features and xcode docs (guess 90% done), github documentation will be provided later.)_\n\n## Requirements\n\n- 📱\tiOS 8.0+\n\n## Installation\n\n#### SwiftPM\n\n#### CocoaPods\n\n__Convenience__ is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile:\n\n```ruby\npod 'Convenience'\n```\n\nand run `pod install` from the terminal.\n\n## License\n\nConvenience is available under the MIT license. See the LICENSE file for more info.\n\n\n\n----\n\n*Feel free to contribute or [communicate](https://twitter.com/mxcat_). I'm open to your ideas.* 🌝\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximkrouk%2Fconvenience","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximkrouk%2Fconvenience","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximkrouk%2Fconvenience/lists"}