Question : find object in array by property swift
Answered by : sore-skylark-wvyrh3g1t9a5
if array.contains(where: {$0.name == "foo"}) { // it exists, do something
} else { //item could not be found
}
Source : https://stackoverflow.com/questions/28727845/find-an-object-in-array/34929289 | Last Update : Thu, 01 Oct 20