back to home

space-code / validator

Validator is a modern, lightweight Swift framework that provides elegant and type-safe input validation.

View on GitHub
86 stars
2 forks
3 issues

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing space-code/validator in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/space-code/validator)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

validator Description Validator is a modern, lightweight Swift framework that provides elegant and type-safe input validation. Built with Swift's powerful type system, it seamlessly integrates with both UIKit and SwiftUI, making form validation effortless across all Apple platforms. Features ✨ **Type-Safe Validation** - Leverages Swift's type system for compile-time safety 🎯 **Rich Rule Set** - Built-in validators for common use cases 🔧 **Extensible** - Easy to create custom validation rules 📱 **UIKit Integration** - First-class support for UITextField and other UIKit components 🎨 **SwiftUI Native** - Property wrappers and view modifiers for declarative validation 📋 **Form Management** - Validate multiple fields with centralized state management ⚡ **Lightweight** - Minimal footprint with zero dependencies 🧪 **Well Tested** - Comprehensive test coverage Table of Contents • Requirements • Installation • Quick Start • Usage • Core Validation • UIKit Integration • SwiftUI Integration • Form Validation • Built-in Validators • Custom Validators • Examples • Communication • Contributing • Development Setup • Code of Conduct • License Requirements | Platform | Minimum Version | |-----------|----------------| | iOS | 16.0+ | | macOS | 13.0+ | | tvOS | 16.0+ | | watchOS | 9.0+ | | visionOS | 1.0+ | | Xcode | 15.3+ | | Swift | 5.10+ | Usage The package contains two libraries: encompasses all validation logic and predefined validators, while implements extensions for integrating the validator into UI objects. It supports both and . Installation Swift Package Manager Add the following dependency to your : Or add it through Xcode: • File > Add Package Dependencies • Enter package URL: • Select version requirements Quick Start Usage The framework provides two main libraries: • **ValidatorCore** - Core validation logic and predefined validators • **ValidatorUI** - UI integration for UIKit and SwiftUI Core Validation Validate any input with the class: UIKit Integration Import to add validation to UIKit components: SwiftUI Integration Single Field Validation Use the modifier for simple field validation: Or use with a custom error view: Form Validation Manage multiple fields with : Built-in Validators | Validator | Description | Example | |-----------|-------------|---------| | | Validates string length (min/max) | | | | Ensures string is not empty or blank | | | | Validates string prefix | | | | Validates string suffix | | | | Pattern matching validation | | | | Validates URL format | | | | Validates credit card numbers (Luhn algorithm) | | | | Validates email format | | | | Validates that a string contains only characters from the allowed CharacterSet | | | | Validates that value is nil | | | Validates that value is positive | | | Validates that a string does not contain any whitespace characters | | | Validates that a string contains a specific substring | | | Validates that the input is equal to a given reference value | | | Validates that input against a comparison constraint | | | Validates that a string is a valid IBAN (International Bank Account Number) | | | Validates that a string is a valid IPv4 or IPv6 address | | | Validates postal/ZIP codes for different countries | | | Validates that a string represents valid Base64-encoded data. | | | Validates UUID format | | | | Validates that a string represents valid JSON | Custom Validators Create custom validation rules by conforming to : Composing Validators Combine multiple validators for complex validation logic: Examples You can find usage examples in the Examples directory of the repository. These examples demonstrate how to integrate the package, configure validation rules, and build real-world user interfaces using and . Communication • 🐛 **Found a bug?** Open an issue • 💡 **Have a feature request?** Open an issue • ❓ **Questions?** Start a discussion • 🔒 **Security issue?** Email nv3212@gmail.com Contributing We love contributions! Please read our Contributing Guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes. Development Setup Bootstrap the development environment: Code of Conduct This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Author **Nikita Vasilev** • Email: nv3212@gmail.com • GitHub: @ns-vasilev License Validator is released under the MIT license. See LICENSE for details. --- **⬆ back to top** Made with ❤️ by space-code