Suchen Sie das Objekt in Array per Property Swift

if array.contains(where: {$0.name == "foo"}) {
   // it exists, do something
} else {
   //item could not be found
}
Sore Skylark