I have array of object and trying get the index for object which is having particular value
for ex. for simple array we can achieve this using
var numbers = [1, 2, 3, 4, 5]
let get3 = exchangeRateList.firstIndex(of: 3). // result 2
how to achieve same for array with objects (for ex. to get index of object having id 3 )
var objarray = [Name]()
objarray.append(Name(id: 1, name: "Nuibb"))
objarray.append(Name(id: 2, name: "Smith"))
objarray.append(Name(id: 3, name: "Pollock"))
objarray.append(Name(id: 4, name: "James"))
objarray.append(Name(id: 5, name: "Farni"))
objarray.append(Name(id: 6, name: "Kuni"))