In my app I have two struct arrays and I want to remove common items from one of them. My struct:
struct PeopleSelectItem { var name = \"\" var id =
Get an array of all ids in selectedPeople
id
let selectedPeopleIDs = selectedPeople.map { $0.id }
Filter the items whose id is not in the array
let filteredPeople = people.filter { !selectedPeopleIDs.contains($0.id) }