I simply would like to find the index of an array of structs containing a search item in the struct. similar to this:
struct Address{
var name:String
var town:String
}
var allAddresses = [Address]()
let newAddress = Address.init(name: "Paul", town: "Heidelberg")
allAddresses.append(newAddress)
//...
let found = allAddresses.name.indexOf("Paul")
//...
but i get
error: value of type '[Address]' has no member 'name'
Is this somehow possible in this manner? Iterating through the array would pose other problems for me!