From ecb1d4313d12b4be0780e7a2a8f3086ea1cfbbc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Faic=CC=A7al=20Tchirou?= Date: Mon, 18 Apr 2022 15:04:52 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d5dc389..48133d7 100644 --- a/README.md +++ b/README.md @@ -341,18 +341,17 @@ let predicate = \Note.numberOfViews ~= 100...200 ###### in -You can use the `in` function to determine whether a property's value is one of the values in a variadic arguments (comma-separated list), an array, or a set. - +You can use the `in` function to determine whether a property's value is one of the values in a variadic list of arguments, an array, or a set. ```swift // Matches all notes where the text is one of the elements in the specified variadic arguments list. -let predicate = (\Note.text).in("a", "b", "c", "d") +let predicate = (\Note.numberOfViews).in(100, 200, 300, 400) // Matches all notes where the text is one of the elements in the specified array. -let predicate = (\Note.text).in(["a", "b", "c", "d"]) +let predicate = (\Note.text).in([100, 200, 300, 400]) // Matches all notes where the text is one of the elements in the specified set. -let predicate = (\Note.text).in(Set(["a", "b", "c", "d"])) +let predicate = (\Note.text).in(Set([100, 200, 300, 400])) ``` When the property type is a `String`, `in` accepts a second parameter that determines how the string should be compared to the elements in the list.