I am trying to create a function that searches through my core data stack and return the amount of messages for a desired key/value.
Here is my code:
let predicate = NSPredicate(format: "SELF[%@] CONTAINS %@",key,value)
This worked for me