A Swift NSPredicate DSL for iOS, macOS, tvOS, and watchOS that provides a type-safe, closure-based alternative to string-based predicates.
PrediKit is a Swift library that provides a domain-specific language (DSL) for creating NSPredicate objects on Apple platforms like iOS, macOS, tvOS, and watchOS. It solves the problem of error-prone, string-based predicate construction by offering a type-safe, closure-based API that improves readability, autocompletion, and runtime safety.
iOS, macOS, tvOS, and watchOS developers who work with Core Data or other predicate-based APIs and want a safer, more expressive way to build queries.
Developers choose PrediKit because it eliminates the common pitfalls of string-based NSPredicates, such as misspelled property names and unreadable complex queries, while providing a fluent, autocomplete-friendly API that integrates seamlessly with Swift's #keyPath syntax.
An NSPredicate DSL for iOS, OSX, tvOS, & watchOS. Inspired by SnapKit and lovingly written in Swift.
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 runtime reflection and Swift's #keyPath syntax to catch misspelled property names at compile-time, preventing silent failures common in string-based predicates as highlighted in the README.
Provides a fluent, closure-based DSL inspired by SnapKit, making complex predicate construction more intuitive and reducing string blindness, with examples showing natural language methods like `matches`.
Integrates seamlessly with Xcode autocomplete and Swift's #keyPath, eliminating the need for external cheatsheets and enhancing safety during property renames, as demonstrated in the Selector Extension Pattern.
Designed with grammatically correct methods such as `doesNot.match`, improving code clarity and maintainability for complex queries, as seen in the README examples.
Only supports Swift on iOS, macOS, tvOS, and watchOS, making it unsuitable for cross-platform projects or environments outside Apple's ecosystem.
Relies on reflection for type safety, which can introduce runtime costs and potential crashes on property validation errors, unlike compile-time solutions.
Requires setup via CocoaPods, Carthage, or manual copy, adding initial overhead compared to using built-in NSPredicate APIs directly.