Find Object In Array By Property Swift

[Solved] Find Object In Array By Property Swift | Swift - Code Explorer | yomemimo.com
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

Answers related to find object in array by property swift

Code Explorer Popular Question For Swift