You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[x] Built-in support for optionals and nested expressions
85
85
-[x] Rich representations for supported data types
86
+
-[x] SwiftData support
87
+
-[x] Support for custom controls for row templates
86
88
87
89
## Not Features
88
90
@@ -92,6 +94,30 @@ As an experimental control, `PredicateView` does not support the following capab
92
94
-[ ] A rich text experience using text attachments
93
95
-[ ] Support for all built-in `PredicateExpression`s
94
96
97
+
## Advanced Capabilities
98
+
99
+
### Custom Predicate Views
100
+
101
+
The `CustomExpressionView` protocol allows you to build custom expression views for key paths not covered by the standard set of built-in expressions. For example, when working with CloudKit in SwiftData, you may choose to implement a custom picker for your enums and dynamically convert them to raw values for their representation in the model layer.
102
+
103
+
A custom predicate expression may be used as a row template just like any of the standard ones:
`PredicateView` supports taking `Predicate`s as input and populating the control from them. This makes it convenient to store user-built predicates in a database and subsequently allowing your users to modify them. Most built-in expression view types support decoding. Custom expressions may choose to opt into the decoding capability by implementing a single method. The decoding support is opt-in and *not* all-or-nothing. You may elect some expression views to not allow decoding, in which case they will not be populated when the control is instantiated using a non-trivial `Predicate` instance. Conformance is independent, so this decision does not affect other custom expression views or any of the built-in ones.
120
+
95
121
## Compatibility
96
122
97
-
Compatibility matches that of the [Swift predicates](https://forums.swift.org/t/pitch-swift-predicates/62000) feature; namely macOS 14.0+, iOS 17.0+, watchOS 10.0+.
123
+
Compatibility matches that of the [Swift predicates](https://forums.swift.org/t/pitch-swift-predicates/62000) feature; namely macOS 14.0+, iOS 17.0+, watchOS 10.0+, visionOS 1.0+.
0 commit comments