From 342606db9964cbb4a5586efbc3772711fa4ab5d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Thu, 27 Feb 2020 19:31:20 -0800 Subject: [PATCH] [ios, macos] Documented new aggregate predicate support --- platform/darwin/docs/guides/For Style Authors.md.ejs | 1 + .../darwin/docs/guides/Predicates and Expressions.md | 11 ++++++++++- platform/ios/docs/guides/For Style Authors.md | 1 + platform/macos/docs/guides/For Style Authors.md | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/platform/darwin/docs/guides/For Style Authors.md.ejs b/platform/darwin/docs/guides/For Style Authors.md.ejs index 8df541d0f..0cba86d71 100644 --- a/platform/darwin/docs/guides/For Style Authors.md.ejs +++ b/platform/darwin/docs/guides/For Style Authors.md.ejs @@ -347,6 +347,7 @@ In style specification | Method, function, or predicate type | Format string syn `at` | `objectFrom:withIndex:` | `array[n]` `get` | `+[NSExpression expressionForKeyPath:]` | Key path `has` | `mgl_does:have:` | `mgl_does:have:(self, 'key')` +`in` | `NSInPredicateOperatorType` | `needle IN haystack` or `haystack CONTAINS needle` or `ANY haystack = needle` `length` | `count:` | `count({1, 2, 2, 3, 4, 7, 9})` `!` | `NSNotPredicateType` | `NOT (p0 OR … OR pn)` `!=` | `NSNotEqualToPredicateOperatorType` | `key != value` diff --git a/platform/darwin/docs/guides/Predicates and Expressions.md b/platform/darwin/docs/guides/Predicates and Expressions.md index b2e01b94d..8dd3664f7 100644 --- a/platform/darwin/docs/guides/Predicates and Expressions.md +++ b/platform/darwin/docs/guides/Predicates and Expressions.md @@ -55,6 +55,13 @@ The following aggregate operators are supported: `NSInPredicateOperatorType` | `key IN { 'iOS', 'macOS', 'tvOS', 'watchOS' }` `NSContainsPredicateOperatorType` | `{ 'iOS', 'macOS', 'tvOS', 'watchOS' } CONTAINS key` +The following combinations of comparison operators and modifiers are supported: + +`NSComparisonPredicateModifier` | `NSPredicateOperatorType` | Format string syntax +--------------------------------|-------------------------------------|--------------------- +`NSAllPredicateModifier` | `NSNotEqualToPredicateOperatorType` | `ALL haystack != needle` +`NSAnyPredicateModifier` | `NSEqualToPredicateOperatorType` | `ANY haystack = needle`
`SOME haystack = needle` + The following comparison predicate options are supported for comparison and aggregate operators that are used in the predicate: @@ -65,7 +72,9 @@ aggregate operators that are used in the predicate: Other comparison predicate options are unsupported, namely `l` (for locale sensitivity) and `n` (for normalization). A comparison is -locale-sensitive as long as it is case- or diacritic-insensitive. +locale-sensitive as long as it is case- or diacritic-insensitive. Comparison +predicate options are not supported in conjunction with comparison modifiers +like `ALL` and `ANY`. ### Operands diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md index d6259238f..cbaa5b83c 100644 --- a/platform/ios/docs/guides/For Style Authors.md +++ b/platform/ios/docs/guides/For Style Authors.md @@ -340,6 +340,7 @@ In style specification | Method, function, or predicate type | Format string syn `at` | `objectFrom:withIndex:` | `array[n]` `get` | `+[NSExpression expressionForKeyPath:]` | Key path `has` | `mgl_does:have:` | `mgl_does:have:(self, 'key')` +`in` | `NSInPredicateOperatorType` | `needle IN haystack` or `haystack CONTAINS needle` or `ANY haystack = needle` `length` | `count:` | `count({1, 2, 2, 3, 4, 7, 9})` `!` | `NSNotPredicateType` | `NOT (p0 OR … OR pn)` `!=` | `NSNotEqualToPredicateOperatorType` | `key != value` diff --git a/platform/macos/docs/guides/For Style Authors.md b/platform/macos/docs/guides/For Style Authors.md index 399ba6804..34af689fe 100644 --- a/platform/macos/docs/guides/For Style Authors.md +++ b/platform/macos/docs/guides/For Style Authors.md @@ -333,6 +333,7 @@ In style specification | Method, function, or predicate type | Format string syn `at` | `objectFrom:withIndex:` | `array[n]` `get` | `+[NSExpression expressionForKeyPath:]` | Key path `has` | `mgl_does:have:` | `mgl_does:have:(self, 'key')` +`in` | `NSInPredicateOperatorType` | `needle IN haystack` or `haystack CONTAINS needle` or `ANY haystack = needle` `length` | `count:` | `count({1, 2, 2, 3, 4, 7, 9})` `!` | `NSNotPredicateType` | `NOT (p0 OR … OR pn)` `!=` | `NSNotEqualToPredicateOperatorType` | `key != value`