{"id":15038658,"url":"https://github.com/gkaimakas/swiftvalidatorsreactiveextensions","last_synced_at":"2025-10-04T03:32:02.168Z","repository":{"id":62456851,"uuid":"86808784","full_name":"gkaimakas/SwiftValidatorsReactiveExtensions","owner":"gkaimakas","description":"SwiftValidators that play nice with ReactiveSwift's ValidatingProperty","archived":true,"fork":false,"pushed_at":"2019-02-12T12:02:25.000Z","size":72,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-28T16:37:58.097Z","etag":null,"topics":["cocoapods","ios","pods","swift","swift-3","swift3","validation","validator","xcode"],"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/gkaimakas.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":"2017-03-31T10:43:24.000Z","updated_at":"2024-08-23T11:43:11.000Z","dependencies_parsed_at":"2022-11-01T22:33:08.596Z","dependency_job_id":null,"html_url":"https://github.com/gkaimakas/SwiftValidatorsReactiveExtensions","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/gkaimakas/SwiftValidatorsReactiveExtensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkaimakas%2FSwiftValidatorsReactiveExtensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkaimakas%2FSwiftValidatorsReactiveExtensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkaimakas%2FSwiftValidatorsReactiveExtensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkaimakas%2FSwiftValidatorsReactiveExtensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gkaimakas","download_url":"https://codeload.github.com/gkaimakas/SwiftValidatorsReactiveExtensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkaimakas%2FSwiftValidatorsReactiveExtensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278259829,"owners_count":25957547,"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-10-04T02:00:05.491Z","response_time":63,"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","ios","pods","swift","swift-3","swift3","validation","validator","xcode"],"created_at":"2024-09-24T20:39:31.819Z","updated_at":"2025-10-04T03:32:01.847Z","avatar_url":"https://github.com/gkaimakas.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift Validators Reactive Extensions :large_orange_diamond:\n\n`ReactiveSwift`'s `ValidatingProperty` is the ideal place to apply SwiftValidators. `SwiftValidatorsReactiveExtensions` provides a set of extensions that make working with `ValidatingProperty` easy.\n\n## Contents\n+ [Installation](#installation)\n+ [Walkthrough](#walkthrough)\n+ [Usage](#usage)\n+ [Available validators](#supported-functions)\n+ [License](#license-mit)\n\n### Installation\n\n`SwiftValidatorsReactiveExtensions` is available on CocoaPods for iOS 9.0+, Xcode 8 and Swift 3.0\n\n````\npod 'SwiftValidatorsReactiveExtensions'\n````\n\n### Walkthrough\n#### Usage\n\n`SwiftValidatorsReactiveExtensions` exposes a `reactive` property in `Validator` that maps each available validator to a `ReactiveValidator`. A `ReactiveValidator` can validate a value that conforms to `StringConvertible` and the result will be `ValidatorOutput\u003cStringConvertible?, ValidationError\u003e`.\n\n`ValidationError` is an enum that conform to `Swift.Error` and provides cases for all available validators in `SwiftValidators` and a special case `.notSpecified` for when the error is not specified.\n\n```swift\nValidator.reactive\n.isEmail().apply(\"gkaimakas@gmail.com\") // returns .valid\n\nValidator.reactive\n.isEmail().apply(\"abcd\") // returns .invalid(.isEmail)\n```\n\nFor more examples on how to call each validator you can look at the [unit tests](https://github.com/gkaimakas/SwiftValidatorsReactiveExtensions/blob/master/Example/Tests/Tests.swift).\n\n#### Logical Operators\n\n`ReactiveValidator` exposes the `combine` function both as a `static` function and as an `instance` function. The `combine` function is equivalent to a logical and meaning that all validators must be `.valid` for the combined validator to be `.valid`.\n\n```swift\nReactiveValidator.combine(\nValidator.reactive.isEmail(), \nValidator.reactive.isLowercase()\n) // variadic function\n\nReactiveValidator\n.combine([\nValidator.reactive.isEmail(), \nValidator.reactive.isLowercase()\n]) // array arguments\n\nValidator.reactive\n.isEmail()\n.combine(with: Validator.reactive.isLowercase()) // instance function\n```\n\n#### Mapping\n\n`SwiftValidatorsReactiveExtensions` provide a `map` function to map the result of a `ReactiveValidator` ValidatorOutput\u003cStringConvertible?, ValidationError\u003e to the exact ValidatorOutput that the `ValidatingProperty` expects.\n\n\n```swift\nemail = ValidatingProperty\u003cString?, ValidationError\u003e(nil, { (value: String?) -\u003e ValidatorOutput\u003cString?, ValidationError\u003e in\nreturn ReactiveValidator.combine([\nValidator.reactive.required(),\nValidator.reactive.minLength(5),\nValidator.reactive.maxLength(32),\nValidator.reactive.isEmail()\n])\n.apply(value)\n.map() { $0 as? String }\n})\n```\n\n### Available Validators\n\nAll the Validators that are available in [`SwiftValidators`](https://github.com/gkaimakas/SwiftValidators#supported-functions).\n\n\n### License MIT\n\n````\nCopyright (c) George Kaimakas gkaimakas@gmail.com\n\nPermission is hereby granted, free of charge, to any person obtaining \nacopy of this software and associated documentation files (the \n\"Software\"), to deal in the Software without restriction, including \nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to \npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be \nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, \nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF \nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND \nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE \nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION \nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION \nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkaimakas%2Fswiftvalidatorsreactiveextensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgkaimakas%2Fswiftvalidatorsreactiveextensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkaimakas%2Fswiftvalidatorsreactiveextensions/lists"}