Upvote:15

Aprove answer
let resultPredicateShoppingListDetail = NSPredicate(format: "%K == %@",
                 #keyPath(ShoppingList.Id), shoppingListModel.Id)

Credit Goes to: stackoverflow.com

Related question with same questions but different answers