Last active
June 3, 2017 10:48
-
-
Save Czajnikowski/2c3d3400bbdbc3f2c9c48ccf12001d11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let fetchRequest = NSFetchRequest<Contact>( | |
entityName: Contact.entity().name! | |
) | |
fetchRequest.predicate = NSCompoundPredicate( | |
orPredicateWithSubpredicates: [ | |
"name", | |
"surname", | |
"city" | |
] | |
.map { | |
NSPredicate( | |
format: "SELF.%K == %@", | |
$0, | |
searchQuery | |
) | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment