Skip to content

Commit 0370676

Browse files
committed
[README] Contain Attributes
1 parent 4da4ae5 commit 0370676

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,32 @@ count and an error if the operation failed.
9898
queryset.delete()
9999
```
100100

101+
### Attributes
102+
103+
The `Attribute` is a generic structure for creating predicates providing
104+
type-safety.
105+
106+
```swift
107+
let name = Attribute<String>("name")
108+
let age = Attribute<Int>("age")
109+
110+
name == "Kyle"
111+
112+
age == 27
113+
age >= 25
114+
```
115+
116+
#### Operators
117+
118+
| Comparison | Meaning |
119+
| ------- |:--------:|
120+
| == | x equals y |
121+
| != | x is not equal to y |
122+
| < | x is less than y |
123+
| <= | x is less than or equal to y |
124+
| > | x is more than y |
125+
| >= | x is more than or equal to y |
126+
101127
## Predicate extensions
102128

103129
We've extended NSPredicate to add support for the `!`, `&&` and `||` operators

0 commit comments

Comments
 (0)