A Swift package for validating properties using property wrappers with built-in and custom validation rules.
ValidatedPropertyKit is a Swift package that provides property wrapper-based validation for Swift properties. It allows developers to declaratively specify validation rules (like email format, string length, or custom logic) directly on property declarations, ensuring data integrity with minimal boilerplate. It integrates seamlessly with SwiftUI for real-time validation feedback and UI state management.
Swift developers building iOS, macOS, or other Apple platform applications who need robust and declarative property validation, especially those using SwiftUI or looking to reduce validation boilerplate in their models.
Developers choose ValidatedPropertyKit for its elegant integration with Swift's property wrappers, extensive built-in validation rules, and seamless SwiftUI support, offering a type-safe and declarative alternative to manual validation logic.
Easily validate your Properties with Property Wrappers 👮
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Swift's property wrappers to specify validation rules directly on properties, reducing boilerplate code as shown in the @Validated attribute examples.
Seamlessly works with SwiftUI for real-time view updates and disabled state management, demonstrated with the .validated() modifier in the login view example.
Includes built-in validations for strings, collections, equatable types, and more, saving development time and covering common use cases, as listed in the Predefined Validations section.
Supports combining validations with AND (&&), OR (||), and NOT (!) operators, allowing complex rule definitions without custom logic, illustrated in the Validation Operators section.
Exclusive to Swift and Apple ecosystems, with no support for cross-platform projects or other programming languages, limiting its applicability.
Validation rules are defined at compile-time using property wrappers, which lacks flexibility for dynamic or context-dependent validations that might change during app execution.
With a version of 0.0.6, the package is in early development and may have unstable APIs or breaking changes, as indicated by the low version number in the README.